thomasr / json.sortify Goto Github PK
View Code? Open in Web Editor NEWA deterministic version of JSON.stringify that sorts object keys alphabetically.
Home Page: https://www.npmjs.com/package/json.sortify
License: Apache License 2.0
A deterministic version of JSON.stringify that sorts object keys alphabetically.
Home Page: https://www.npmjs.com/package/json.sortify
License: Apache License 2.0
This package is dependent on npm: '~1.0.20' Which I think nobody has, I guess it should be >1.0.20? also because node must be greater as 4 so this gives warnings while running npm 8:
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=4.0.0', npm: '~1.0.20' },
npm WARN EBADENGINE current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
Hello,
I'm getting the error
JSON.sortify.js:1 Uncaught ReferenceError: definition is not defined
on latest version. I hadn't the same problem on earlier version.
Do I need to do anything different (I seems to comply with the docs, though) or something went wrong with the build?
Thank you!
Andrea
Currently, there is a very basic test in smoke.html, but that should be automated.
Hey there,
I'm just wondering if there would be some way you could change the lib to be compiled down to an earlier js version. Currently uglify is choking on the ()=> syntax:
static/js/main.39077179.js from UglifyJs
Unexpected token: operator (>) [./~/json.sortify/lib/index.js:29,0][static/js/main.39077179.js:127447,20]
Thank you!
I dont know why
Let's say I have the following JSON object:
{
"name" : "John",
"age" : 55,
"sex" : "M"
}
using sortify, of course it will sort them by alphabetical order. However, what if I always wanted the JSON to be exported in the format as above? Is there a way to pass in similar to a whitelist--but have the whitelist retain the order as I enter it?
For example to replicate structure above, the call would be:
JSON.sortify(data, ['name', 'age', 'sex']);
JSON.sortify({b:1,foo:2,a:3}, ['a', 'foo']);
{
"b": 1
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.