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

19 lines
496 B
TypeScript

/**
* Creates a function that gets the argument at index `n`. If `n` is negative, the nth argument from the end is returned.
*
* @param {number} [n=0] - The index of the argument to return.
* @returns {(...args: any[]) => any} Returns the new function.
*
* @example
* var func = nthArg(1);
* func('a', 'b', 'c', 'd');
* // => 'b'
*
* var func = nthArg(-2);
* func('a', 'b', 'c', 'd');
* // => 'c'
*/
declare function nthArg(n?: number): (...args: any[]) => any;
export { nthArg };