@babel/helper-wrap-function
Advanced tools
Comparing version 7.14.5 to 7.15.4
@@ -12,4 +12,13 @@ "use strict"; | ||
var t = require("@babel/types"); | ||
var _t = require("@babel/types"); | ||
const { | ||
blockStatement, | ||
callExpression, | ||
functionExpression, | ||
isAssignmentPattern, | ||
isRestElement, | ||
returnStatement | ||
} = _t; | ||
const buildAnonymousExpressionWrapper = _template.default.expression(` | ||
@@ -45,4 +54,4 @@ (function () { | ||
const body = node.body; | ||
const container = t.functionExpression(null, [], t.blockStatement(body.body), true); | ||
body.body = [t.returnStatement(t.callExpression(t.callExpression(callId, [container]), []))]; | ||
const container = functionExpression(null, [], blockStatement(body.body), true); | ||
body.body = [returnStatement(callExpression(callExpression(callId, [container]), []))]; | ||
node.async = false; | ||
@@ -71,3 +80,3 @@ node.generator = false; | ||
const built = t.callExpression(callId, [node]); | ||
const built = callExpression(callId, [node]); | ||
const container = wrapper({ | ||
@@ -78,3 +87,3 @@ NAME: functionId || null, | ||
PARAMS: node.params.reduce((acc, param) => { | ||
acc.done = acc.done || t.isAssignmentPattern(param) || t.isRestElement(param); | ||
acc.done = acc.done || isAssignmentPattern(param) || isRestElement(param); | ||
@@ -81,0 +90,0 @@ if (!acc.done) { |
{ | ||
"name": "@babel/helper-wrap-function", | ||
"version": "7.14.5", | ||
"version": "7.15.4", | ||
"description": "Helper to wrap functions inside a function call.", | ||
@@ -17,6 +17,6 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-function-name": "^7.14.5", | ||
"@babel/template": "^7.14.5", | ||
"@babel/traverse": "^7.14.5", | ||
"@babel/types": "^7.14.5" | ||
"@babel/helper-function-name": "^7.15.4", | ||
"@babel/template": "^7.15.4", | ||
"@babel/traverse": "^7.15.4", | ||
"@babel/types": "^7.15.4" | ||
}, | ||
@@ -23,0 +23,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5299
104
+ Added@babel/code-frame@7.24.7(transitive)
+ Added@babel/generator@7.25.6(transitive)
+ Added@babel/helper-string-parser@7.24.8(transitive)
+ Added@babel/helper-validator-identifier@7.24.7(transitive)
+ Added@babel/highlight@7.24.7(transitive)
+ Added@babel/parser@7.25.6(transitive)
+ Added@babel/template@7.25.0(transitive)
+ Added@babel/traverse@7.25.6(transitive)
+ Added@babel/types@7.25.6(transitive)
+ Addedjsesc@2.5.2(transitive)
- Removed@babel/code-frame@7.25.7(transitive)
- Removed@babel/generator@7.25.7(transitive)
- Removed@babel/helper-string-parser@7.25.7(transitive)
- Removed@babel/helper-validator-identifier@7.25.7(transitive)
- Removed@babel/highlight@7.25.7(transitive)
- Removed@babel/parser@7.25.7(transitive)
- Removed@babel/template@7.25.7(transitive)
- Removed@babel/traverse@7.25.7(transitive)
- Removed@babel/types@7.25.7(transitive)
- Removedjsesc@3.0.2(transitive)
Updated@babel/template@^7.15.4
Updated@babel/traverse@^7.15.4
Updated@babel/types@^7.15.4