UNPKG

evt

Version:

Type safe replacement for node's EventEmitter

15 lines (12 loc) 427 B
import { ReduceArguments, toReduceArguments } from "./reduceify"; export function arrAnd<ArrOf>( arr: readonly ArrOf[], conditions: ((arr: readonly ArrOf[]) => boolean)[] ): boolean { return !conditions.find(condition => !condition(arr)); } export function and<ArrOf>( conditions: ((arr: readonly ArrOf[]) => boolean)[] ): ReduceArguments<ArrOf, boolean> { return toReduceArguments(arrAnd, conditions); }