get-parameter-names
get-parameter-names copied to clipboard
fix bug when function like as 'f(id = 1)'
function f(id = 1){
id = 'a,b';
}
getParameterNames(f); // => [ 'id', 'b\';' ]
@goatslacker Hi, please help me to review it~
Can you write a unit test to demonstrate this failure? Bonus points if you can also get this function to parse: ( a = 1 , b=2, c = (err, data)=>{}) => {}
Just FYI that CaptEmulation/get-parameter-names handles this case. npm i @captemulation/get-parameter-names