Immutate
Immitating Immutable Mutations - Functional mutations for deep data structures
Install
npm install --save immutate
Usage
Just import the module:
;
...or if you only want one of the functions:
;
API
;// => {a: {b: {}}},
;// => 'c'
;// => {a: {b: {c: [1, 2]}}}
;// => {a: {b: {c: [1, 2, 3, 4, 5, 6]}}}
;// => {a: {b: {c: 'see'}}}
;// => {a: {b: {c: 'is for cookie'}}}
;// => {a: {b: {c: [2, 3]}}}
;// => [2, 3]
;// => {a: {b: {c: [1, 2, 3]}}}
;// => {a: {b: {c: [0, 'one', 'two', 3]}}}
;// => {a: {b: {c: 'C'}}}
;// => {a: {b: {c: [-2, -1, 0, 1, 2, 3]}}}