diff options
author | Luke Karrys <luke@lukekarrys.com> | 2022-02-23 22:32:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-23 22:32:54 +0300 |
commit | 1b4385f85e8f6dd5015080cdd3e02a8fa3749ffd (patch) | |
tree | 9d264f792a33681a533757ac8b6c1cfd59e2bf2f /workspaces/arborist/bin | |
parent | 63b35578bd759cb5f3edaaef1c1122ecd0b27f48 (diff) |
fix(arborist): convert all sorting to string-locale-compare (#4465)
Diffstat (limited to 'workspaces/arborist/bin')
-rw-r--r-- | workspaces/arborist/bin/license.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/workspaces/arborist/bin/license.js b/workspaces/arborist/bin/license.js index 7fc08dd83..af34fece6 100644 --- a/workspaces/arborist/bin/license.js +++ b/workspaces/arborist/bin/license.js @@ -1,4 +1,5 @@ const Arborist = require('../') +const localeCompare = require('@isaacs/string-locale-compare')('en') const options = require('./lib/options.js') require('./lib/logging.js') require('./lib/timers.js') @@ -24,7 +25,7 @@ a.loadVirtual().then(tree => { } for (const [count, license] of set.sort((a, b) => - a[1] && b[1] ? b[0] - a[0] || a[1].localeCompare(b[1], 'en') + a[1] && b[1] ? b[0] - a[0] || localeCompare(a[1], b[1]) : a[1] ? -1 : b[1] ? 1 : 0)) { |