dot-wild
dot-wild copied to clipboard
get all possible paths?
Example input:
{
a: {
b: {
c: 123,
d: 'yo'
}
},
z: 'text'
}
Expected output:
a.b.c
a.b.d
a.b
a
z
Is there any way to use dot-wild to say "show me all possible paths and their values"? Flatten seems the closest, but doesn't show objects or arrays. forEach there doesn't seem to be a way to make it recurse all the way down. Maybe the internal each
method?