@unction/dig
v1.14.0
Published
Takes a chain of keys and a tree, traversing down and reaching the last value
Downloads
23
Readme
@unction/dig
Array => B => C
Takes a chain of keys and a tree, traversing down and reaching the last value. If any part of the chain is undefined or not an object the result will always be undefined.
dig(["aaa", "bbb", "ccc"])({aaa: {bbb: {ccc: "1"}}}) // "1"
dig(["aaa", "ddd", "ccc"])({aaa: {bbb: {ccc: "1"}}}) // undefined