uni-ticket-system/node_modules/licia/property.js
2023-12-05 10:11:10 +08:00

16 lines
362 B
JavaScript

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;