Creates an ArrayTypeGuard that checks that the value is an array and all elements match isValue.
ArrayTypeGuard
isValue
Can be shortened with TypeGuard.array.
TypeGuard.array
The type of elements in the array
The type guard for individual array elements
A type guard for T[]
T[]
const isNumberArray = isArray(isNumber); // or isNumber.array()isNumberArray([1, 2, 3]); // trueisNumberArray([1, "hello"]); // false Copy
const isNumberArray = isArray(isNumber); // or isNumber.array()isNumberArray([1, 2, 3]); // trueisNumberArray([1, "hello"]); // false
Creates an
ArrayTypeGuardthat checks that the value is an array and all elements matchisValue.Can be shortened with
TypeGuard.array.