Find nested properties in an object by specifying a path, eg "level1.level2.0.name".
var findByPath = require('findByPath'),
obj = {
level1: true,
parent: {
level2: "true"
}
};
findByPath(obj, 'level1'); // true
findByPath(obj, 'parent.level2'); // "true"
findByPath(obj, 'parent/level2', '/'); // "true"
findByPath(obj, 'parent.child'); // undefined
See tests for more examples.
Rodney Rehm contributed the better part of the code to Reol.js. Thanks!