ast-redeclare
Hoist and fold variable declarations within scopes, so that each variable has only one declaration per scope. Don’t touch functions. Useful to normalize code before analysis, like data-flow etc.
Usage
npm install ast-redeclare
var parse = parse;var generate = generate;var redeclare = ; var ast = ;ast = ; ;//var a, b, c, d; a = 1; b = 2; if (a > 1) { c = b; } else { c = 3; }; d = 4;