utils: fix

This commit is contained in:
undefined committed 2021-05-06 18:22:42 +08:00
1 parent dcc6a27bbc
commit e89c5cd10e
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -395,7 +395,7 @@ const fSortR = /[^\d]+|\d+/g;
export function sortFiles(files: { _id: string }[] | string[]) {
const isString = typeof files[0] === 'string';
const result = files
.map((i) => (isString ? { name: i, weights: i.match(fSortR) } : { ...i, weights: i.match(fSortR) }))
.map((i) => (isString ? { name: i, weights: i.match(fSortR) } : { ...i, weights: i._id.match(fSortR) }))
.sort((a, b) => {
let pos = 0;
const weightsA = a.weights;