UNPKG

@arrows/array

Version:
17 lines (16 loc) 592 B
declare type TestFn<T> = (element: T, index: number, arr: T[]) => boolean; declare type _Every = <T>(testFn: TestFn<T>, arr: T[]) => boolean; declare type _Every2 = <T>(testFn: TestFn<T>) => (arr: T[]) => boolean; declare type Every = _Every & _Every2; /** * Functional wrapper for Array.prototype.every * * Determines whether all the members of an array satisfy the specified test. * * @param testFn Test function * @param arr Initial array * @returns True if all elements satisfy test function, false otherwise */ declare const every: Every; export { every }; export default every;