Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 53446e2

Browse files
committed
Merge branch 'master' into gh-157
2 parents 971342a + c4c0955 commit 53446e2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/core/create_routes.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ export default function create_routes({ files } = { files: glob.sync('**/*.*', {
3030
return !found;
3131
})
3232
.sort((a, b) => {
33-
const max = Math.max(a.parts.length, b.parts.length);
33+
if (a.parts[0] === '4xx' || a.parts[0] === '5xx') return -1;
34+
if (b.parts[0] === '4xx' || b.parts[0] === '5xx') return 1;
3435

35-
if (max === 1) {
36-
if (a.parts[0] === '4xx' || a.parts[0] === '5xx') return -1;
37-
if (b.parts[0] === '4xx' || b.parts[0] === '5xx') return 1;
38-
}
36+
const max = Math.max(a.parts.length, b.parts.length);
3937

4038
for (let i = 0; i < max; i += 1) {
4139
const a_part = a.parts[i];

0 commit comments

Comments
 (0)