Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
17
node_modules/next/dist/esm/client/components/router-reducer/create-router-cache-key.js
generated
vendored
Normal file
17
node_modules/next/dist/esm/client/components/router-reducer/create-router-cache-key.js
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment';
|
||||
export function createRouterCacheKey(segment, withoutSearchParameters) {
|
||||
if (withoutSearchParameters === void 0) withoutSearchParameters = false;
|
||||
// if the segment is an array, it means it's a dynamic segment
|
||||
// for example, ['lang', 'en', 'd']. We need to convert it to a string to store it as a cache node key.
|
||||
if (Array.isArray(segment)) {
|
||||
return segment[0] + "|" + segment[1] + "|" + segment[2];
|
||||
}
|
||||
// Page segments might have search parameters, ie __PAGE__?foo=bar
|
||||
// When `withoutSearchParameters` is true, we only want to return the page segment
|
||||
if (withoutSearchParameters && segment.startsWith(PAGE_SEGMENT_KEY)) {
|
||||
return PAGE_SEGMENT_KEY;
|
||||
}
|
||||
return segment;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=create-router-cache-key.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue