测试
安装步骤
测试
- 这是1
- 这是2
小细节
分支步骤
const safeGet = (data, path) => {
if(!path) return undefined;
const pathArr = path.split('.');
let result = data;
let length = pathArr.length
while(length--) {
const iter = pathArr.shift();
result = result[iter];
if(result === undefined) return undefined;
}
return result
}