Creates a SetTypeGuard that validates that the value is a Set and all its elements match the provided type guard.
SetTypeGuard
Set
Can be shortened with TypeGuard.set.
TypeGuard.set
The type of elements in the set
The type guard for individual set elements
A type guard for Set<T>
Set<T>
const isNumberSet = isSet(isNumber); // or isNumber.set()isNumberSet(new Set([1, 2, 3])); // trueisNumberSet(new Set([1, "hello"])); // false Copy
const isNumberSet = isSet(isNumber); // or isNumber.set()isNumberSet(new Set([1, 2, 3])); // trueisNumberSet(new Set([1, "hello"])); // false
Creates a
SetTypeGuardthat validates that the value is aSetand all its elements match the provided type guard.Can be shortened with
TypeGuard.set.