@uzelux/json
v1.0.0
Published
JSON Object Extension
Downloads
3
Readme
JSON Plus
An extension to the build-in JSON object
USAGE
require('@uzelux/json');
Clean
This is to remove all undefined values within the JSON
JSON.clean({a: 'value', b: undefined, c: null, d: '', e: [], f: {}});
// {a: 'value', c: null, d: '', e: [], f: {}}
Purge
This is to remove all empty values (null, empty string, empty array, zero property object)
JSON.clean({a: 'value', b: undefined, c: null, d: '', e: [], f: {}});
// {a: 'value'}