Refactor function positional arguments to named parameters?
Is there is a way to refactor function positional arguments to named parameters?
From this:
function login( name, pass ) {}
login('name', 'pass');
To this:
function login( { name, pass } ){}
login({ name: 'name', pass: 'pass' });
Asking because ES6 is everywhere around and I need to convert bunch of legacy code.
Please sign in to leave a comment.
Convert parameters to object intention
will change your code to
Thanks. But why this options are not in the refactoring menu, considering that fact that this is actually refactoring functional?
For historical reasons - lots of refactorings are implemented as intentions
Does this work for python code? On my computer it doesnt...