Wraps a function to handle optional arguments as an array.
The tuple type of the required arguments.
The type of the optional arguments.
The function to wrap.
Rest
const wrappedFn = wrapFunctionWithOptionalArgs((a: number, b: number, options: number[]) => { console.log(a, b, options);});wrappedFn(1, 2, 3, 4, 5); // Output: 1 2 [3, 4, 5] Copy
const wrappedFn = wrapFunctionWithOptionalArgs((a: number, b: number, options: number[]) => { console.log(a, b, options);});wrappedFn(1, 2, 3, 4, 5); // Output: 1 2 [3, 4, 5]
Generated using TypeDoc
Wraps a function to handle optional arguments as an array.