isSubsetWith es-toolkit
Checks if one array is a subset of another array based on a custom comparison function.
Usage
isSubsetWith(superset, subset, areItemsEqual)
Use isSubsetWith when you want to verify a subset relationship using a user-defined comparison function. This is useful when comparing objects or when special comparison logic is needed.
Complex comparison logic can also be used.
Parameters
The superset array that may contain all elements of the subset.
The subset array to check if it's contained in the superset.
A function to determine if two elements are equal. Should return true if equal, false otherwise.
Returns
Based on the custom comparison function, returns true if all elements of the subset are contained in the superset, otherwise returns false.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.