import { List , Predicate } from '../types' ; import { curry2 } from '@typed/functions' ; import { not } from '../not' ; name export const allPass = curry2 ( __allPass ) ; export type AllPass = { < A > ( predicates , value ) : boolean ; < A > ( predicates ) : Predicate < A > ; } ; function __allPass < A > ( predicates , value ) { const predicateCount = predicates . length ; for ( let i = 0 ; i < predicateCount ; ++ i ) if ( not ( predicates [ i ] ( value ) ) ) return false ; return true ; }