set-new
Set value and return new object without mutating the original object.
INSTALLATION
npm install set-new --save
USAGE
With object:
const set = ;const source = some: nested: 'object' ; const result = ; sourcesomenested === 'object'; // trueresultsomenested === 'changed'; // true const another = ; resultsomenested === 'changed'; // trueanothersomenested === 'another'; // true
With array:
const set = ;const source = 'some' 'nested' 'array'; const result = ; source11 === 'object'; // trueresult11 === 'changed'; // true const another = ; result11 === 'changed'; // trueanother11 === 'another'; // true