UNPKG

nope-js-browser

Version:

NoPE Runtime for the Browser. For nodejs please use nope-js-node

41 lines (40 loc) 1.3 kB
/** * Helper to extrat the code of the function: * * @example * ```javascript * function func(betterMakeSure, itWorksWith, longVariables = 'too') {} * * const r = extractArgumentsPartFromFunction(func); * * // => r = (betterMakeSure,itWorksWith,longVariables='too') * * ``` * @param func * @returns */ export declare function _extractArgumentsPartFromFunction(func: any): string; /** * Helper to count all arguments of an function (including the optional ones.) * @param func The function, where we want to count the parameters * @returns */ export declare function countAllArguments(func: any): number; /** * Helper to count the arguments. * @param func The function ot be analysed * @returns */ export declare function countArguments(func: any): { optional: number; static: number; total: number; }; /** * Helper to fill provided arguments for the function. * @param func The function ot be analysed * @param providedArg The allready provided args * @param argsToFill The Arguments to fill * @param fromEnd A Flag to toggle, whether the arguments should be filled from the end or the beginning. */ export declare function fillOptionalArguments(func: any, providedArg: any[], argsToFill: any[], fromEnd?: boolean): any[];