isSubsetWith
Import from @varavel/vdl-plugin-sdk/utils/arrays.
Checks if the subset array is entirely contained within the superset array based on a custom equality function.
This function takes two arrays and a custom comparison function. It returns a boolean indicating whether all elements in the subset array are present in the superset array, as determined by the provided custom equality function.
Type Parameters
| Type Parameter | Description |
|---|---|
T |
The type of elements contained in the arrays. |
Parameters
| Parameter | Type | Description |
|---|---|---|
superset |
readonly T[] |
The array that may contain all elements of the subset. |
subset |
readonly T[] |
The array to check against the superset. |
areItemsEqual |
(x, y) => boolean |
A function to determine if two items are equal. |
Returns
boolean
- Returns
trueif all elements of the subset are present in the superset according to the custom equality function, otherwise returnsfalse.