Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this update will sort keys as native
.sort()
which isC.UTF-8
(POSIX) sort - not locale independent.this will fix locale sorting problem in npm's
package-lock.json
npm/cli#2829same problem was fixed in 2017 https://github.com/npm/npm/pull/17844/files but now sorting package.json and package-lock.json are again locale independend in npm 7
for me this is a big issue, because some of us in our company is working with english OS, some in slovak and both package.json and package-lock files are changing with every
npm install
if you are on
*nix
system, you can testLC_ALL=sk node test.js
andLC_ALL=en-US node test.js
with node 14 (node < 14 dont have full-icu, so only en-US was supported) to see different output of this library for examplech
is 1 character is slovak language and its betweenh
andi
, but in english it's 2 character, so it is betweenb
andd
test.js:
result:
I was trying to fix this by forcing
en-US
locale, but,C
anden-US
sort is not the same; for example-
is after_
in en-US, but before in C.so npm 7 again don't have same sorting as npm 6, when 2017 fix (above) was applied and was using native C sort