Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2021-09-28 21:18:01 +0300
committerisaacs <i@izs.me>2021-09-28 21:52:07 +0300
commitdbb90f7997900b8ae6026dddaa718efe9a1db2f4 (patch)
tree2241c89f49fa3d8291d0123ce52026e6cbe088d4 /lib/help.js
parente94ddeaca1e75ecc8f54ebcb3df222965e3635d1 (diff)
fix: use Intl.Collator for string sorting when availableisaacs/string-locale-compare
The npm/cli form of https://github.com/npm/arborist/pull/324 Required adding options support to package used for this. PR-URL: https://github.com/npm/cli/pull/3809 Credit: @isaacs Close: #3809 Reviewed-by: @wraithgar
Diffstat (limited to 'lib/help.js')
-rw-r--r--lib/help.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/help.js b/lib/help.js
index 8e4ff67bc..9a6f950e0 100644
--- a/lib/help.js
+++ b/lib/help.js
@@ -3,6 +3,7 @@ const path = require('path')
const openUrl = require('./utils/open-url.js')
const { promisify } = require('util')
const glob = promisify(require('glob'))
+const localeCompare = require('@isaacs/string-locale-compare')('en')
const BaseCommand = require('./base-command.js')
@@ -82,7 +83,7 @@ class Help extends BaseCommand {
if (aManNumber !== bManNumber)
return aManNumber - bManNumber
- return a.localeCompare(b, 'en')
+ return localeCompare(a, b)
})
const man = mans[0]