Package Exports
- nestob
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nestob) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
nestob
Helper to set nested properties of objects
//Create a new nestable object - instead of the standard js object ({})
var newNested = new nestob.Nestable();
//Set nested object properties without having to create the objects first!
newNested.setNested('biscuits.oblong.marmaduke', 'cheese');
newNested.setNested('orange.tartan.pipedream', { poppers: 'astray', numbers: [123,456,789]});
console.log(newNested, newNested.orange.tartan.pipedream);
//Get nested object properties without having to worry about whether the objects exist
//Pass in a default value to be returned if desired
console.log(newNested.getNested('generic.yoghurt.asguard', 'autodrome'), newNested.getNested('chips.along.the'));
//You can also use nestob to modify object not created using nestob
var normalObj = {};
nestob.setNested(normalObj, 'running.out.of', 'words');
console.log(normalObj);
console.log(nestob.getNested(normalObj, 'random.things', 'indigo'), nestob.getNested(normalObj, 'improbable.apricots'));