MultiLoader-Template/node_modules/es-toolkit/dist/function/unary.d.ts
3944Realms 768f38fc97 feat: 可使用的构建模板
修改了脚本,使其可以推给Maven仓库
2026-05-03 13:02:19 +08:00

18 lines
530 B
TypeScript

/**
* Creates a function that accepts up to one argument, ignoring any additional arguments.
*
* @template F - The type of the function.
* @param {F} func - The function to cap arguments for.
* @returns {(...args: any[]) => ReturnType<F>} Returns the new capped function.
*
* @example
* function fn(a, b, c) {
* console.log(arguments);
* }
*
* unary(fn)(1, 2, 3); // [Arguments] { '0': 1 }
*/
declare function unary<F extends (...args: any[]) => any>(func: F): (...args: any[]) => ReturnType<F>;
export { unary };