Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jul 8, 2022
1 parent 89f9df2 commit df261c0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/babel-plugin-transform-parameters/src/rest.ts
Expand Up @@ -325,16 +325,13 @@ export default function convertFunctionRest(path: NodePath<t.Function>) {
}
}

let rest = (node.params.pop() as t.RestElement).argument as
| t.Pattern
| t.Identifier;
let rest = restPath.node;
node.params.pop(); // This returns 'rest'

if (t.isPattern(rest)) {
const pattern = rest;
rest = scope.generateUidIdentifier("ref");

console.log(Object.keys(t.getBindingIdentifiers(pattern)));

const declar = t.variableDeclaration("let", [
t.variableDeclarator(pattern, rest),
]);
Expand Down

0 comments on commit df261c0

Please sign in to comment.