source: node_modules/es-toolkit/dist/function/unary.d.ts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 530 bytes
RevLine 
[a762898]1/**
2 * Creates a function that accepts up to one argument, ignoring any additional arguments.
3 *
4 * @template F - The type of the function.
5 * @param {F} func - The function to cap arguments for.
6 * @returns {(...args: any[]) => ReturnType<F>} Returns the new capped function.
7 *
8 * @example
9 * function fn(a, b, c) {
10 * console.log(arguments);
11 * }
12 *
13 * unary(fn)(1, 2, 3); // [Arguments] { '0': 1 }
14 */
15declare function unary<F extends (...args: any[]) => any>(func: F): (...args: any[]) => ReturnType<F>;
16
17export { unary };
Note: See TracBrowser for help on using the repository browser.