object-path-resolve
A 200b (gzipped) utility function to resolve object properties with string paths
API
resolve(obj: Object, path: String)
Retrieve a value from the
obj
based on thepath
(accepts dot and bracket notation)
Usage
const obj = prop: name: 'John' arr: 'one' 'two' 'three' // => 'John' // => undefined // => 'two'