The tuple type inferred from the predicate list.
The value to validate.
A predicate used to validate the tuple elements.
true if the value satisfies the tuple structure, otherwise false.
This function performs strict tuple validation by ensuring:
Unlike isArrayOf, tuple validation is positional and supports
heterogeneous element types.
Validate a string-number tuple:
isTuple(
['hello', 123],
[isString, isNumber]
); // true
Homogeneous tuple check:
isTuple(
['foo', 'bar', '__not_foo_'],
isString
); // true
Invalid tuple length:
isTuple(
['hello', 123, true],
[isString, isNumber]
); // false
Invalid tuple ordering:
isTuple(
[123, 'hello'],
[isString, isNumber]
); // false
Empty tuple:
isTuple([], []); // true
Determines whether the provided value is a tuple whose entries satisfy the given predicates in positional order.