@utilify/core
Version:
Modern, strongly typed, and safe utility function library for JavaScript and TypeScript. Includes type checking, manipulation of arrays, objects, strings, dates, colors, numbers, regular expressions, and more. Compatible with Browser, Node.js, Deno, and B
17 lines • 786 B
TypeScript
type DropFirst<T extends any[]> = T extends [any, ...infer R] ? R : never;
/**
* @callback PartialLeftCallback
* @param {...any} args
* @returns {any}
*/
/**
* Partially applies arguments from the left.
* @template Args,R,P
* @param {PartialLeftCallback} callback - The function to partially apply.
* @param {...P} partial - Arguments to apply from the left.
* @returns {(...args: DropFirst<Args> extends P ? [] : DropFirst<Args>) => R} The partially applied function.
* @throws {TypeError} If callback is not a function.
*/
export default function partialLeft<Args extends any[], R, P extends Partial<Args>>(callback: (...args: Args) => R, ...partial: P): (...args: DropFirst<Args> extends P ? [] : DropFirst<Args>) => R;
export {};
//# sourceMappingURL=partialLeft.d.ts.map