@babel/helper-wrap-function
Advanced tools
+3
-3
@@ -46,4 +46,4 @@ import template from '@babel/template'; | ||
| let params = []; | ||
| const shoudlForwardParams = node.params.some(p => isPattern(p)); | ||
| if (shoudlForwardParams) { | ||
| const shouldForwardParams = node.params.some(p => isPattern(p)); | ||
| if (shouldForwardParams) { | ||
| params = node.params; | ||
@@ -61,3 +61,3 @@ node.params = []; | ||
| const container = functionExpression(null, params, blockStatement(body.body), true); | ||
| if (shoudlForwardParams) { | ||
| if (shouldForwardParams) { | ||
| body.body = [returnStatement(callExpression(memberExpression(callExpression(callId, [container]), identifier("apply")), [thisExpression(), identifier("arguments")]))]; | ||
@@ -64,0 +64,0 @@ path.get("body.body.0.argument.callee.object.arguments.0").unwrapFunctionEnvironment(); |
+4
-4
| { | ||
| "name": "@babel/helper-wrap-function", | ||
| "version": "8.0.0-beta.1", | ||
| "version": "8.0.0-beta.2", | ||
| "description": "Helper to wrap functions inside a function call.", | ||
@@ -17,5 +17,5 @@ "repository": { | ||
| "dependencies": { | ||
| "@babel/template": "^8.0.0-beta.1", | ||
| "@babel/traverse": "^8.0.0-beta.1", | ||
| "@babel/types": "^8.0.0-beta.1" | ||
| "@babel/template": "^8.0.0-beta.2", | ||
| "@babel/traverse": "^8.0.0-beta.2", | ||
| "@babel/types": "^8.0.0-beta.2" | ||
| }, | ||
@@ -22,0 +22,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Updated