File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
packages/runtime/src/templates/edge-shared Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,12 @@ export interface FetchEventResult {
6
6
waitUntil : Promise < any >
7
7
}
8
8
9
- function normalizeDataUrl ( redirect , url ) {
9
+ type NextDataTransform = < T > ( data : T ) => T
10
+
11
+ function normalizeDataUrl ( redirect : string , url : string | URL ) {
10
12
const normalizedUrl = new URL ( redirect , url )
11
13
12
- if (
13
- normalizedUrl . pathname . startsWith ( '/_next/data/' ) &&
14
- normalizedUrl . pathname . endsWith ( '.json' )
15
- ) {
14
+ if ( normalizedUrl . pathname . startsWith ( '/_next/data/' ) && normalizedUrl . pathname . endsWith ( '.json' ) ) {
16
15
const paths = normalizedUrl . pathname
17
16
. replace ( / ^ \/ _ n e x t \/ d a t a \/ / , '' )
18
17
. replace ( / \. j s o n $ / , '' )
@@ -22,7 +21,7 @@ function normalizeDataUrl(redirect, url) {
22
21
normalizedUrl . pathname = paths [ 1 ] !== 'index' ? `/${ paths . slice ( 1 ) . join ( '/' ) } ` : '/'
23
22
}
24
23
25
- return normalizedUrl . pathname + normalizedUrl . search ;
24
+ return normalizedUrl . pathname + normalizedUrl . search
26
25
}
27
26
28
27
/**
You can’t perform that action at this time.
0 commit comments