You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

15 lines
345 B

var isUndef = require('./isUndef');
var castPath = require('./castPath');
exports = function(obj, path) {
path = castPath(path, obj);
var prop;
prop = path.shift();
while (!isUndef(prop)) {
obj = obj[prop];
if (obj == null) return;
prop = path.shift();
}
return obj;
};
module.exports = exports;