json-mutations

0.2.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i json-mutations

Weekly Downloads

1

Version

0.2.0

License

ISC

Unpacked Size

11.8 kB

Total Files

5

Last publish

Collaborators

  • ideascloud