( collection: Iterable<Predicate<A>> )
| 951 | * @see tuple for a more powerful, variadic version. |
| 952 | */ |
| 953 | export const all = <A>( |
| 954 | collection: Iterable<Predicate<A>> |
| 955 | ): Predicate<ReadonlyArray<A>> => { |
| 956 | return (as) => { |
| 957 | let collectionIndex = 0 |
| 958 | for (const p of collection) { |
| 959 | if (collectionIndex >= as.length) { |
| 960 | break |
| 961 | } |
| 962 | if (p(as[collectionIndex]) === false) { |
| 963 | return false |
| 964 | } |
| 965 | collectionIndex++ |
| 966 | } |
| 967 | return true |
| 968 | } |
| 969 | } |
| 970 | |
| 971 | /** |
| 972 | * Combines a predicate for a single value and an iterable of predicates for the rest of an array. |
no test coverage detected