Skip to content

Comments

feat: add "Sort JSON" script#187

Merged
IvanMathy merged 1 commit intoIvanMathy:mainfrom
madnh:feat/script-json-sort
Mar 16, 2021
Merged

feat: add "Sort JSON" script#187
IvanMathy merged 1 commit intoIvanMathy:mainfrom
madnh:feat/script-json-sort

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"
}

@sonarqubecloud
Copy link

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.

3 participants