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:
authorGar <gar+gh@danger.computer>2021-09-28 20:05:08 +0300
committerGar <gar+gh@danger.computer>2021-09-28 20:05:08 +0300
commite94ddeaca1e75ecc8f54ebcb3df222965e3635d1 (patch)
treeb2ec351450e8392bebd0410fe6367101a1e1b4b2 /node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js
parent075fe50565ae5c66df727cdd7df9dd5ed8cd4015 (diff)
deps: @npmcli/arborist@2.9.0
* fix: avoid infinite loops in peer dep replacements * fix: use Intl.Collator for string sorting when available * feat(vuln): expose isDirect
Diffstat (limited to 'node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js')
-rw-r--r--node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js b/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js
index c1b64a461..3c1cbd44a 100644
--- a/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js
+++ b/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js
@@ -1,5 +1,7 @@
// add and remove dependency specs to/from pkg manifest
+const localeCompare = require('@isaacs/string-locale-compare')('en')
+
const add = ({pkg, add, saveBundle, saveType, log}) => {
for (const spec of add) {
addSingle({pkg, spec, saveBundle, saveType, log})
@@ -79,7 +81,7 @@ const addSingle = ({pkg, spec, saveBundle, saveType, log}) => {
// keep it sorted, keep it unique
const bd = new Set(pkg.bundleDependencies || [])
bd.add(spec.name)
- pkg.bundleDependencies = [...bd].sort((a, b) => a.localeCompare(b, 'en'))
+ pkg.bundleDependencies = [...bd].sort(localeCompare)
}
}