EASYAIuniappNewUI/node_modules/licia/property.js
2025-02-08 18:50:38 +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;