( elements: T )
| 1457 | * @since 4.0.0 |
| 1458 | */ |
| 1459 | export function Tuple<const T extends ReadonlyArray<Predicate.Any>>( |
| 1460 | elements: T |
| 1461 | ): [Extract<T[number], Refinement.Any>] extends [never] ? Predicate<{ readonly [I in keyof T]: Predicate.In<T[I]> }> |
| 1462 | : Refinement< |
| 1463 | { readonly [I in keyof T]: T[I] extends Refinement.Any ? Refinement.In<T[I]> : Predicate.In<T[I]> }, |
| 1464 | { readonly [I in keyof T]: T[I] extends Refinement.Any ? Refinement.Out<T[I]> : Predicate.In<T[I]> } |
| 1465 | > |
| 1466 | { |
| 1467 | return ((as: Array<unknown>) => { |
| 1468 | for (let i = 0; i < elements.length; i++) { |
| 1469 | if (elements[i](as[i]) === false) { |
| 1470 | return false |
| 1471 | } |
| 1472 | } |
| 1473 | return true |
| 1474 | }) as any |
| 1475 | } |
| 1476 | |
| 1477 | /** |
| 1478 | * Creates a predicate for objects by applying predicates to named properties. |
nothing calls this directly
no outgoing calls
no test coverage detected