@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 • 799 B
TypeScript
type DropLast<T extends any[], N extends any[]> = T extends [...infer R, ...N] ? R : never;
/**
* @callback PartialRightCallback
* @param {...any} args
* @returns {any|Promise<any>}
*/
/**
* Partially applies arguments from the right.
* @template Args,R,P
* @param {PartialRightCallback} callback - The function to partially apply.
* @param {...P} partial - Arguments to apply from the right.
* @returns {(...args: DropLast<Args, P>) => R | Promise<R>} The partially applied function.
* @throws {TypeError} If callback is not a function.
*/
export default function partialRight<Args extends any[], R, P extends Partial<Args>>(callback: (...args: Args) => R | Promise<R>, ...partial: P): (...args: DropLast<Args, P>) => R | Promise<R>;
export {};
//# sourceMappingURL=partialRight.d.ts.map