import { curryN } from '@unboxing/function' import { ArrPred } from '@unboxing/core' interface All { (fn: ArrPred, list: ArrayLike): boolean; (fn: ArrPred): (list: ArrayLike) => boolean; } // Returns `true` if all the elements of the array match the predicate, `false` otherwise. export const arrayAll = curryN(2, (fn: ArrPred, arr: ArrayLike = []) => { for (let i = 0; i < arr.length; i++) { if (!fn(arr[i], i, arr)) { return false; } } return true; }) as All