mirror of
https://github.com/withastro/astro.git
synced 2025-03-31 23:31:30 -05:00
[ci] format
This commit is contained in:
parent
a4b696def3
commit
8bc3b66d4d
2 changed files with 18 additions and 18 deletions
|
@ -197,7 +197,7 @@ function routeComparator(a: ManifestRouteData, b: ManifestRouteData) {
|
|||
// For sorting purposes, an index route is considered to have one more segment than the URL it represents.
|
||||
const aLength = a.isIndex ? a.segments.length + 1 : a.segments.length;
|
||||
const bLength = b.isIndex ? b.segments.length + 1 : b.segments.length;
|
||||
|
||||
|
||||
// Sort more specific routes before less specific routes
|
||||
if (aLength !== bLength) {
|
||||
return aLength > bLength ? -1 : 1;
|
||||
|
|
|
@ -129,23 +129,23 @@ describe('routing - createRouteManifest', () => {
|
|||
});
|
||||
|
||||
expect(getManifestRoutes(manifest)).to.deep.equal([
|
||||
{
|
||||
"route": "/",
|
||||
"type": "page",
|
||||
},
|
||||
{
|
||||
"route": "/static",
|
||||
"type": "page",
|
||||
},
|
||||
{
|
||||
"route": "/[dynamic]",
|
||||
"type": "page",
|
||||
},
|
||||
{
|
||||
"route": "/[...rest]",
|
||||
"type": "page",
|
||||
},
|
||||
]);
|
||||
{
|
||||
route: '/',
|
||||
type: 'page',
|
||||
},
|
||||
{
|
||||
route: '/static',
|
||||
type: 'page',
|
||||
},
|
||||
{
|
||||
route: '/[dynamic]',
|
||||
type: 'page',
|
||||
},
|
||||
{
|
||||
route: '/[...rest]',
|
||||
type: 'page',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('injected routes are sorted in legacy mode above filesystem routes', async () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue