func-args
ECMAScript Function Arguments parser, Get arguments of a function, useful for and used in dependency injectors. Works for regular functions, generator functions and arrow functions.
npm install func-args
api
- index.d.ts
- by default will throw error if func is native or bounded func
demo
see _tests.ts
; ; ; console.dir, ;/*{ args: [ 'a', 'b', 'c', { e: 'e', d: 'd' }, [ 'aa1', 'aa2', { aaa3: 'aaa3' }, [ 'bbb1', 'bbb2', { bbb4: 'bbb4' } ], '...rrr' ], 'e2', 'f', 'f2', '...argv' ], params: [ 'a', 'b', 'c', 'e', 'd', 'aa1', 'aa2', 'aaa3', 'bbb1', 'bbb2', 'bbb4', '...rrr', 'e2', 'f', 'f2', '...argv' ] } */ // skip throw error if func is native or bounded funcconsole.dirparseFuncMath.abs, true, ;/*{ type: undefined, name: 'abs', native: true, generator: undefined, async: undefined, args: [], params: [], source: 'function abs() { [native code] }' }*/