UNPKG

ts-prime

Version:

A utility library for JavaScript and Typescript.

32 lines 988 B
/** * Creates a function with `data-first` and `data-last` signatures. * * `purry` is a dynamic function and it's not type safe. It should be wrapped by a function that have proper typings. * Refer to the example below for correct usage. * * @param fn the function to purry. * @param args the arguments * @signature P.purry(fn, arguments); * @example * function _findIndex(array, fn) { * for (let i = 0; i < array.length; i++) { * if (fn(array[i])) { * return i; * } * } * return -1; * } * * // data-first * function findIndex<T>(array: T[], fn: (item: T) => boolean): number; * * // data-last * function findIndex<T>(fn: (item: T) => boolean): (array: T[]) => number; * * function findIndex() { * return P.purry(_findIndex, arguments); * } * @category Function */ export declare function purry(fn: any, args: IArguments | readonly any[], lazy?: any): any; //# sourceMappingURL=purry.d.ts.map