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