amis-rpc-design/node_modules/rc-util/es/utils/get.js

10 lines
251 B
JavaScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
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;
}