@ideascloud/json-mutations
v0.2.1
Published
Usage
Downloads
1
Readme
json-mutations
Usage
const jsonMutations = require('json-mutations');
let output = jsonMutations.mutateJSON({
asd: [123]
}, {
action: 'ARRAY_POP_ITEM',
paths: ['(@)asd'],
params: {}
});
// Output: { asd: [] }
Paths prefixes
- (@) Select attribute
- (#) Select array index
- (&) Select array item on condition match