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

JSON sort changed behaviour to case sensitive #244

Open
j-seixas opened this issue Sep 24, 2024 · 0 comments
Open

JSON sort changed behaviour to case sensitive #244

j-seixas opened this issue Sep 24, 2024 · 0 comments

Comments

@j-seixas
Copy link

j-seixas commented Sep 24, 2024

From this change #238, the sort JSON fixed the randomization if the same key is present in different cases (lower vs upper), but introduced an ASCII sorting, meaning that changed the behaviour of sorting.

Example

{
  "ba": "something",
  "Ab": "something",
  "aa": "something",
  "Bb": "something",
}

Expected behaviour - and how it was before:

{
  "aa": "something",
  "Ab": "something",
  "ba": "something",
  "Bb": "something",
}

Current behaviour - ignores the actual ascending sort (a before b, and only sorts by ascii code)

{
  "Ab": "something",
  "Bb": "something",
  "aa": "something",
  "ba": "something"
}

Can the comparison of the ascii be made to have only if the lowercase version of the 2 letters are the same?
E.g. lowercase(a) === lowercase(b) && a !== b -> compare it by ascii, if not do the same as it was

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant