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
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 implementeachTree
andfilterTree
methods, as a higher level alternatives foreachDeep
andfilterDeep
. This methods will acceptchildrenField
argument, which can be string path, regex or array of any of this. Default value will bechildren