get-parameter-names
get-parameter-names copied to clipboard
Retrieves the argument names of a function
Could be cool to be able to handle functions with arguments destructuring like that : function({ prop1, "my-prop2": prop2 = 'default', p3 : { sp1 }, ...rest }, arg2) =>...
- Support for ES6 class constructors - Support for default arguments - Fixes a variety of edge cases However... because we are now doing more parsing... - bigger - slower...
function (a,b,c=1) { .. code here ... } returns a,b, ...first line of code... This is because the following regexp doesn't end on a bracket.... const DEFAULT_PARAMS = /=[^,]+/mg; Changing...
I don't want this comment "lost" in pull #7 where I originally put it. https://github.com/benbotto/get-parameter-names 0.3.2 still has the following problem: ( a = 1 , b=2, c = (err,...
``` function f(id = 1){ id = 'a,b'; } getParameterNames(f); // => [ 'id', 'b\';' ] ```
Input: c => { let test2 = c.resolve(); return new Test3(test2); } Expected output: ['c'] Output: [ 'c', 'let', 'test2' ] Input: c => { var test2 = c.resolve(); return...
Input: ``` a => { return new Promise((resolve, reject) => { setTimeout(() => resolve(a * 2), 500); }); } ``` Expected output: `['a']` Output: `[ '(resolve', 'reject' ]` Other things...