-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deepTransform Transforms a recursive iterable by a given function. Works like deepMap but allows you to stop transforming at any point of the tree. The traversing happens depth first. deepFind Goes over every `{ key, value }` of a recursive iterable data structure (for arrays being numeric key and the value at the key position), and uses a function to extract elements at any point in the tree onto an array that is returned. If a third argument, the limit, is provided, it will stop iterating as soon as the number of found objects reaches that limit. Why? Because this will allow me to find the first two nested occurrences of a terms object with a field property and to modify the first so that it has: `collect_mode: 'breadth_first'`
- Loading branch information
Showing
4 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters