YuriGor / deepdash

eachDeep, filterDeep, findDeep, someDeep, omitDeep, pickDeep, keysDeep etc.. Tree traversal library written in Underscore/Lodash fashion
https://deepdash.io/
MIT License
275 stars 12 forks source link

Trees with explicitly children field declared #6

Closed YuriGor closed 5 years ago

YuriGor commented 5 years ago

It's a common case when object has regular structure with predictable children array name. If it's defined beforehand, we can process nodes rather than separate fields. This way filtering becomes much easier. I think I need to implement eachTree and filterTree methods, as a higher level alternatives for eachDeep and filterDeep. This methods will accept childrenField argument, which can be string path, regex or array of any of this. Default value will be children

YuriGor commented 5 years ago

I decided to add 'tree' option into the existing methods. Already done for eachDeep filterDeep, indexate, paths, omitDeep, pickDeep are coming soon.