Tree.

paths(tree, [options])

Returns an array of slash-separated paths for all values in the map-based tree.

The options argument can include:

  • assumeSlashKeys: if true, the operation will skip descending into a value if the tree supports trailing slashes and the key does not end in a trailing slash. This speeds up the operation on large trees.
  • base: a string that will be prepended to all the paths.

Example #

$ ori greetings.yaml
english:
  a: Hello, a.
  b: Hello, b.
  c: Hello, c.
french:
  a: Bonjour, a.
  b: Bonjour, b.
  c: Bonjour, c.
spanish:
  a: Hola, a.
  b: Hola, b.
  c: Hola, c.
$ ori Tree.paths greetings.yaml
- english/a
- english/b
- english/c
- french/a
- french/b
- french/c
- spanish/a
- spanish/b
- spanish/c

To obtain a mapping of slash-separated paths to values, see Tree.deflatePaths.