Tree.

flat(map, [depth])

Flattens the values of the map-based tree to the indicated depth, with a default depth of 1.

$ ori Tree.flat { a: 1, more: { b: 2 }}
- 1
- b: 2
$ ori Tree.flat { a: 1, more: { b: 2 }}, 2
- 1
- 2

If the supplied depth is Infinity, the Tree.flat function works like Tree.deepValues:

$ ori Tree.flat { a: 1, more: { b: 2, sub: { c: 3 } }}, Infinity
- 1
- 2
- 3
$ ori Tree.deepValues { a: 1, more: { b: 2, sub: { c: 3 } }}
- 1
- 2
- 3