filter
Import from @varavel/vdl-plugin-sdk/utils/sets.
Filters a Set based on a predicate function.
This function takes a Set and a predicate function, and returns a new Set containing only the elements for which the predicate function returns true.
Type Parameters
| Type Parameter | Description |
|---|---|
T |
The type of elements in the Set. |
Parameters
| Parameter | Type | Description |
|---|---|---|
set |
Set\<T> |
The Set to filter. |
callback |
(value, value2, set) => boolean |
A predicate function that tests each element. |
Returns
Set\<T>
A new Set containing only the elements that satisfy the predicate.