Function: findChildren()
function findChildren<T>(
root,
predicate,
options?
): ReadonlySet<T>;
Iterates through all children and collects them in a set if the given predicate matches.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends object | any |
Parameters
| Parameter | Type | Description |
|---|---|---|
root | object | Root object to get the matching children from. |
predicate | (node) => boolean | Function that will be run for every child of the root object. |
options? | { deep?: boolean; } | An optional object with the deep option (defaults to false) set to true to get the children deeply or false to get them shallowly. |
options.deep? | boolean | - |
Returns
ReadonlySet<T>
A readonly set with the matching children.