amis-rpc-design/node_modules/rc-util/es/utils/get.js
2023-10-07 19:42:30 +08:00

10 lines
251 B
JavaScript

export default function get(entity, path) {
var current = entity;
for (var i = 0; i < path.length; i += 1) {
if (current === null || current === undefined) {
return undefined;
}
current = current[path[i]];
}
return current;
}