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

Sort a numeric set by increasing or decreasing value #86

Open
coilysiren opened this issue Oct 7, 2024 · 0 comments
Open

Sort a numeric set by increasing or decreasing value #86

coilysiren opened this issue Oct 7, 2024 · 0 comments

Comments

@coilysiren
Copy link

coilysiren commented Oct 7, 2024

Context

I have the following lists:

fileA.json

  "Numbers": [
    3,
    12,
    30
  ],

fileB.json

  "Numbers": [
    2,
    10,
    20
  ],

Current Behavior

I get a diff like so:

file.txt
@ ["Numbers",["set"],{}]
- 12
- 30
- 3
+ 10
+ 2
+ 20

Desired Behavior

I get the numbers back in a sorted order. Either in the sorted order from the original files (increasing), or some other sorted order. Like so:

file.txt
@ ["Numbers",["set"],{}]
- 3
- 12
- 30
+ 2
+ 10
+ 20

I think what is happening right now is that the numbers are turned into strings, and then sorted that way?

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