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

feat: add "Sort JSON" script #187

Merged
merged 1 commit into from
Mar 16, 2021
Merged

Conversation

madnh
Copy link

@madnh madnh commented Sep 28, 2020

This script sort JSON content by its keys, support nested objects/array:

Before:

{
  "name": "Tom",
  "age": 5,
  "movies": [
    {
      "name": "Toy Story 4",
      "year": 2019,
      "rating": 97
    },
    {
      "name": "Spider-Man: Into the Spider-Verse",
      "year": 2018,
      "rating": 96
    }
  ]
}

After:

{
  "age": 5,
  "movies": [
    {
      "name": "Toy Story 4",
      "rating": 97,
      "year": 2019
    },
    {
      "name": "Spider-Man: Into the Spider-Verse",
      "rating": 96,
      "year": 2018
    }
  ],
  "name": "Tom"
}

@sonarcloud
Copy link

sonarcloud bot commented Sep 28, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@IvanMathy
Copy link
Owner

This is awesome, thanks for the PR!

@IvanMathy IvanMathy merged commit daadbcd into IvanMathy:main Mar 16, 2021
@madnh madnh deleted the feat/script-json-sort branch May 28, 2021 15:29
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

Successfully merging this pull request may close these issues.

None yet

3 participants