find
Import from @varavel/vdl-plugin-sdk/utils/sets.
Finds the first element in a Set for which the predicate function returns true.
This function iterates through the elements of the Set and returns the first element for which the predicate function returns true. If no element satisfies the predicate, it returns undefined.
Type Parameters
| Type Parameter | Description |
|---|---|
T |
The type of elements in the Set. |
Parameters
| Parameter | Type | Description |
|---|---|---|
set |
Set\<T> |
The Set to search. |
doesMatch |
(value, value2, set) => boolean |
A predicate function that tests each element. |
Returns
T | undefined
The first element that satisfies the predicate, or undefined if none found.