dot-wild icon indicating copy to clipboard operation
dot-wild copied to clipboard

get all possible paths?

Open yocontra opened this issue 5 years ago • 0 comments

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?

yocontra avatar Aug 03 '18 15:08 yocontra