Skip to content

Commit 529b2df

Browse files
committed
fix(util): use numeric sorting for natural sort;
- will handle migration files with varying prefix length
1 parent 5c6de35 commit 529b2df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { resolve } = require('path');
55
exports.glob = async function (dir) {
66
const output = [];
77
await totalist(dir, (name, abs) => output.push({ name, abs }));
8-
return output.sort((a, b) => a.name.localeCompare(b.name)); // ~rand order
8+
return output.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric:true })); // ~rand order
99
}
1010

1111
exports.diff = function (prevs, nexts) {

0 commit comments

Comments
 (0)