follow key-paths through nested objects
var pathway = ;var xs =x : y : z : 555beep : 'boop'x : y : z : 444 w : 4x : y : 'zzz'x : y : z : 333X : y : z : 222;var ys = ;consoledirys;
[ 555, 444, 333, 222 ]
var pathway =
Return an array of all the matching paths through the nested object
match the key path route
Key paths determine how to proceed deeper into the object for each element. Key paths may contain these kinds of elements:
f(key, value), return truthiness
key: trueproperty, the result of the expression in the output at this key is the array path instead of the value
Some types may select multiple matching results at a given node, in which case all the matching nodes at that level will be followed forward into the result until a later condition isn't satisfied.
This behavior is heavily inspired by how
With npm do:
npm install pathway
This module was written high up in a tree at Mosswood Park.