@midwayjs/coreFunctionssafelyGet版本:NextsafelyGet CallablesafelyGet(list: string | string[], obj?: Record<string, unknown>): any@examplesafelyGet(['a','b'],{a: {b: 2}}) // => 2 safelyGet(['a','b'],{c: {b: 2}}) // => undefined safelyGet(['a','1'],{a: {"1": 2}}) // => 2 safelyGet(['a','1'],{a: {b: 2}}) // => undefined safelyGet('a.b',{a: {b: 2}}) // => 2 safelyGet('a.b',{c: {b: 2}}) // => undefined@since2.0.0
2.0.0