diff options
author | isaacs <i@izs.me> | 2021-05-07 02:06:29 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-05-10 19:37:12 +0300 |
commit | 1d092144eaaabff63ac8424b40b2286822be7677 (patch) | |
tree | cfc63a6d91736f3165fcc4d38431ff3a2819b660 /package-lock.json | |
parent | 1eb7e5c7d466293b472c2506c64e5a89ec84ac2f (diff) |
fix(packages): locale-agnostic string sorting
This adds the 'en' locale to all instances of String.localeCompare
within the CLI codebase.
Tests added for the cases where we're sorting arbitrary user-generated
data. The tests rely on the fact that 'ch' sorts after 'd' in the
`'sk'` locale, but ahead of `'d'` in the `'en'` locale. To ensure that
this is the default behavior if no locale is specified, `LC_ALL=sk` is
set in the test environment.
Other instances of `localeCompare` sort data that the cli controls, so
no tests were added.
Re: https://github.com/npm/cli/issues/2829
PR-URL: https://github.com/npm/cli/pull/3203
Credit: @isaacs
Close: #3203
Reviewed-by: @ruyadorno
Diffstat (limited to 'package-lock.json')
0 files changed, 0 insertions, 0 deletions