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:
Diffstat (limited to 'lib/cache.js')
-rw-r--r--lib/cache.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/cache.js b/lib/cache.js
index aed2cce31..4a5665111 100644
--- a/lib/cache.js
+++ b/lib/cache.js
@@ -8,6 +8,7 @@ const semver = require('semver')
const BaseCommand = require('./base-command.js')
const npa = require('npm-package-arg')
const jsonParse = require('json-parse-even-better-errors')
+const localeCompare = require('@isaacs/string-locale-compare')('en')
const searchCachePackage = async (path, spec, cacheKeys) => {
const parsed = npa(spec)
@@ -212,10 +213,10 @@ class Cache extends BaseCommand {
for (const key of keySet)
results.add(key)
}
- [...results].sort((a, b) => a.localeCompare(b, 'en')).forEach(key => this.npm.output(key))
+ [...results].sort(localeCompare).forEach(key => this.npm.output(key))
return
}
- cacheKeys.sort((a, b) => a.localeCompare(b, 'en')).forEach(key => this.npm.output(key))
+ cacheKeys.sort(localeCompare).forEach(key => this.npm.output(key))
}
}