Detalhes do pacote

nessy

coderaiser46.6kMIT5.3.0

set value in nested object

json, object, value, nested

readme (leia-me)

Nessy NPM version Build Status Coverage Status

Set value in nested object.

Install

npm i nessy --save

Hot to use?

const nessy = require('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'],
});

Related

License

MIT