npm.io
8.1.0 • Published 8 years ago

@unction/keychain

Licence
ISC
Version
8.1.0
Deps
3
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

NOTE: This library has been deprecated in favor of unction/dig

@unction/keyChain

Tests Stability Dependencies

KeyChainType => TreeType => ValueType

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.

keyChain(["aaa", "bbb", "ccc"])({aaa: {bbb: {ccc: "1"}}}) // "1"
keyChain(["aaa", "ddd", "ccc"])({aaa: {bbb: {ccc: "1"}}}) // undefined

Keywords