var zc = require('zero-config');
var config = zc(process.cwd());
config.set('lol', { foo: { bar: 42 }});
console.log(config.get('lol'));
// {foo: { bar : 42 }}
config.get('lol').foo = 'mutated internally' // this is not good
console.log(config.get('lol'));
// { foo: 'mutated internally' }
I think that you should only be able to mutate the config via .set().
.get() should return copies/clones of objects, not internal references.
Here's what I'm talking about:
I think that you should only be able to mutate the config via
.set()
..get()
should return copies/clones of objects, not internal references.