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.
20 lines
400 B
20 lines
400 B
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.get = get;
|
|
/** `lodash.get` */
|
|
function get(obj, key) {
|
|
const branches = key.split('.');
|
|
let current = obj;
|
|
let branch;
|
|
while (branch = branches.shift()) {
|
|
if (!(branch in current)) {
|
|
return undefined;
|
|
}
|
|
current = current[branch];
|
|
}
|
|
return current;
|
|
}
|
|
//# sourceMappingURL=obj.js.map
|