mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
utils: fix
This commit is contained in:
1 parent
dcc6a27bbc
commit
e89c5cd10e
2 files changed
+2
-2
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user