-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow more control over sorting #1
Comments
Wouldn't a |
Hi, thanks for the response (and the recent release 👍). Sorry I didn't explain very well, here is an example used to generate a form: {
"someid": {
"name": "abc",
"fields": {
"name": {
"meta": "here",
"order": 0
},
"email": {
"meta": "here",
"order": 1
}
}
},
"anotherid": {
"name": "something",
"fields": {
"button-text-1": {
"meta": "here",
"order": 0
},
"button-url-1": {
"meta": "here",
"order": 1
},
"button-text-2": {
"meta": "here",
"order": 2
},
"button-url-2": {
"meta": "here",
"order": 3
}
}
}
} With {
"anotherid": {
"fields": {
"button-text-1": {
"meta": "here",
"order": 0
},
"button-text-2": {
"meta": "here",
"order": 2
},
"button-url-1": {
"meta": "here",
"order": 1
},
"button-url-2": {
"meta": "here",
"order": 3
}
},
"name": "something"
},
"someid": {
"fields": {
"email": {
"meta": "here",
"order": 1
},
"name": {
"meta": "here",
"order": 0
}
},
"name": "abc"
}
} The JSON is still valid/works but it is harder for a human to parse because the I was suggesting being able to pass an int (e.g. |
In our project we want to sort everything in a json file, apart from any
fields
sub-keys where having them in a set order makes sense contextually, even if it just to make it easier for the programmer to look at the file.I'm not sure what the best way of specifying this would be but having
sortKeys
accept a depth parameter might be a simply way of giving a bit more control.The text was updated successfully, but these errors were encountered: