Objectify
This node library allows you to set, get or check for the predicate of a deeply nested objects.
It lets you avoid patterns such as:
if myObjoptions && myObjoptionssite && myObjoptionssiteurl // do something with myObj.options.site.url
And it helps you avoid the popular undefined is not a function
error.
Examples
var objectify = ; var src = {};
Check for the existence of a nested attribute:
if // true or false // do something with the nested attr here console;
Getting a long nested attribute:
src = a: very: deeply: nested: attr: 1 ; ; // returns 1 ; // returns undefined
Setting a deep nested attribute:
; // returns 2 console // 2