$ cnpm install nessy
Set value in nested object.
npm i nessy --save
import {nessy} form 'nessy';
nessy('hello.world', 'why not?', '.', {
hello: {
world: 'could be used in browser as well',
},
});
// returns
({
hello: {
world: 'why not?',
},
});
nessy('hello*world', 'why not?', '*', {
hello: {
world: 'can be used any divider',
},
});
// returns
({
hello: {
world: 'why not?',
},
});
// even arrays supported
nessy('hello.0', 'world', {});
// returns
({
hello: ['world'],
});
MIT
Copyright 2013 - present © cnpmjs.org | Home |