first commit

This commit is contained in:
2026-06-15 00:55:47 -06:00
commit 2bd1e0399a
98 changed files with 9986 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
const filenameCollator = new Intl.Collator('zh-CN', {
numeric: true,
sensitivity: 'base',
})
export function sortFilesNaturally<T extends { name: string }>(
files: readonly T[],
): T[] {
return [...files].sort((left, right) =>
filenameCollator.compare(left.name, right.name),
)
}