Skip to content

Commit a11a313

Browse files
cooltyp100szaimen
authored andcommitted
Fix: Sorting filenames containing numbers
Signed-off-by: Adrian Thiele <[email protected]>
1 parent bb04707 commit a11a313

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/fileUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ const sortCompare = function(fileInfo1, fileInfo2, key, asc = true) {
7373

7474
// finally sort by name
7575
return asc
76-
? fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage())
77-
: -fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage())
76+
? fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage(), { numeric: true })
77+
: -fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage(), { numeric: true })
7878
}
7979

8080
export type FileInfo = object

0 commit comments

Comments
 (0)