Create a type predicate function that checks if input is an array matching the given tupleShape.
input
tupleShape
const isNameAgeTuple = tuple([isString, isNumber]);isNameAgeTuple(['Andy', 30]); // trueisNameAgeTuple([30, 'Andy']); // falseisNameAgeTuple(['Andy', 30, 'extra']); // false Copy
const isNameAgeTuple = tuple([isString, isNumber]);isNameAgeTuple(['Andy', 30]); // trueisNameAgeTuple([30, 'Andy']); // falseisNameAgeTuple(['Andy', 30, 'extra']); // false
Create a type predicate function that checks if
inputis an array matching the giventupleShape.