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
362 B
15 lines
362 B
var isArr = require('./isArr');
|
|
var safeGet = require('./safeGet');
|
|
exports = function(path) {
|
|
if (!isArr(path)) return shallowProperty(path);
|
|
return function(obj) {
|
|
return safeGet(obj, path);
|
|
};
|
|
};
|
|
function shallowProperty(key) {
|
|
return function(obj) {
|
|
return obj == null ? void 0 : obj[key];
|
|
};
|
|
}
|
|
|
|
module.exports = exports;
|
|
|