We should not modify the type of a variable at runtime, this can be error prone and misleading:
results.decl.unshift(decl);
results.decl = t.variableDeclaration("const", results.decl); // decl's type changed from `array` to `t.VariableDeclaration`
To fix this, we can create another property to save the original declarations.
Motivation
We should not modify the type of a variable at runtime, this can be error prone and misleading:
To fix this, we can create another property to save the original declarations.