Skip to content

Commit 03f29a2

Browse files
committed
sort
1 parent 0d5e2e8 commit 03f29a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/routes/tutorial/[slug]/_/Folder.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
/** @type {Array<import('$lib/types').Stub>} */
1717
export let files;
1818
19-
$: children = files.filter((file) => file.name.startsWith(prefix));
19+
$: children = files
20+
.filter((file) => file.name.startsWith(prefix))
21+
.sort((a, b) => (a.name < b.name ? -1 : 1));
2022
$: child_directories = children.filter(
2123
(child) => child.depth === depth + 1 && child.type === 'directory'
2224
);

0 commit comments

Comments
 (0)