Skip to content

Commit 14bc77c

Browse files
committed
fix in sortRoutePaths: sort files alphabetically
1 parent 25e6357 commit 14bc77c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/fresh/src/fs_routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export function sortRoutePaths(a: string, b: string) {
247247
if (scoreA === scoreB) {
248248
if (charA !== charB) {
249249
// TODO: Do we need localeSort here or is this good enough?
250-
return charA < charB ? 0 : 1;
250+
return charA < charB ? -1 : 1;
251251
}
252252
continue;
253253
}
@@ -257,7 +257,7 @@ export function sortRoutePaths(a: string, b: string) {
257257

258258
if (charA !== charB) {
259259
// TODO: Do we need localeSort here or is this good enough?
260-
return charA < charB ? 0 : 1;
260+
return charA < charB ? -1 : 1;
261261
}
262262

263263
// If we're at the end of A or B, then we assume that the longer

0 commit comments

Comments
 (0)