mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
[ci] format
This commit is contained in:
parent
633eeaa9d8
commit
878f7f60ba
1 changed files with 24 additions and 23 deletions
|
@ -31,29 +31,30 @@ export function getRouteGenerator(
|
|||
trailing = '/';
|
||||
}
|
||||
|
||||
const path = segments
|
||||
.map((segment) => {
|
||||
return (
|
||||
'/' +
|
||||
segment
|
||||
.map((part) => {
|
||||
if (part.spread) {
|
||||
return `${sanitizedParams[part.content.slice(3)] || ''}`;
|
||||
} else if (part.dynamic) {
|
||||
return `${sanitizedParams[part.content] || ''}`;
|
||||
} else {
|
||||
return part.content
|
||||
.normalize()
|
||||
.replace(/\?/g, '%3F')
|
||||
.replace(/#/g, '%23')
|
||||
.replace(/%5B/g, '[')
|
||||
.replace(/%5D/g, ']');
|
||||
}
|
||||
})
|
||||
.join('')
|
||||
);
|
||||
})
|
||||
.join('') + trailing;
|
||||
const path =
|
||||
segments
|
||||
.map((segment) => {
|
||||
return (
|
||||
'/' +
|
||||
segment
|
||||
.map((part) => {
|
||||
if (part.spread) {
|
||||
return `${sanitizedParams[part.content.slice(3)] || ''}`;
|
||||
} else if (part.dynamic) {
|
||||
return `${sanitizedParams[part.content] || ''}`;
|
||||
} else {
|
||||
return part.content
|
||||
.normalize()
|
||||
.replace(/\?/g, '%3F')
|
||||
.replace(/#/g, '%23')
|
||||
.replace(/%5B/g, '[')
|
||||
.replace(/%5D/g, ']');
|
||||
}
|
||||
})
|
||||
.join('')
|
||||
);
|
||||
})
|
||||
.join('') + trailing;
|
||||
|
||||
return path || '/';
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue