Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
19
node_modules/next/dist/esm/shared/lib/segment.js
generated
vendored
Normal file
19
node_modules/next/dist/esm/shared/lib/segment.js
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
export function isGroupSegment(segment) {
|
||||
// Use array[0] for performant purpose
|
||||
return segment[0] === '(' && segment.endsWith(')');
|
||||
}
|
||||
export function isParallelRouteSegment(segment) {
|
||||
return segment.startsWith('@') && segment !== '@children';
|
||||
}
|
||||
export function addSearchParamsIfPageSegment(segment, searchParams) {
|
||||
const isPageSegment = segment.includes(PAGE_SEGMENT_KEY);
|
||||
if (isPageSegment) {
|
||||
const stringifiedQuery = JSON.stringify(searchParams);
|
||||
return stringifiedQuery !== '{}' ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery : PAGE_SEGMENT_KEY;
|
||||
}
|
||||
return segment;
|
||||
}
|
||||
export const PAGE_SEGMENT_KEY = '__PAGE__';
|
||||
export const DEFAULT_SEGMENT_KEY = '__DEFAULT__';
|
||||
|
||||
//# sourceMappingURL=segment.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue