Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid locale-specific string sorting issues #3203

Merged
merged 1 commit into from May 10, 2021

Commits on May 10, 2021

  1. 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: #2829
    
    PR-URL: #3203
    Credit: @isaacs
    Close: #3203
    Reviewed-by: @ruyadorno
    isaacs authored and wraithgar committed May 10, 2021
    Copy the full SHA
    1d09214 View commit details
    Browse the repository at this point in the history