@kilianvalkhof/treecko
v1.0.0
Published
Functional tree helpers
Downloads
11
Readme
treecko
A collection of functional and immutable helpers for working with tree data structures.
- All of the following helpers support tree objects as well as arrays of tree objects.
- All methods are curried, so you can use partial application.
- Tree nodes must have a
children
array.
Mapping
Reducing
Finding
Filtering
Side Effects
Flattening
Restructuring
Misc
TODO
- [ ] Support different values for
children
key - [ ] Support different values for
id
key inflattenToMap
andchangeParent
- [ ] Support different values for
parentId
key inchangeParent
- [ ] Add breadth-first versions of methods