@babel/plugin-transform-parameters
Advanced tools
Comparing version 7.12.13 to 7.13.0
@@ -23,6 +23,7 @@ "use strict"; | ||
var _default = (0, _helperPluginUtils.declare)((api, options) => { | ||
var _api$assumption; | ||
api.assertVersion(7); | ||
const { | ||
loose | ||
} = options; | ||
const ignoreFunctionLength = (_api$assumption = api.assumption("ignoreFunctionLength")) != null ? _api$assumption : options.loose; | ||
const noNewArrows = api.assumption("noNewArrows"); | ||
return { | ||
@@ -33,7 +34,9 @@ name: "transform-parameters", | ||
if (path.isArrowFunctionExpression() && path.get("params").some(param => param.isRestElement() || param.isAssignmentPattern())) { | ||
path.arrowFunctionToExpression(); | ||
path.arrowFunctionToExpression({ | ||
noNewArrows | ||
}); | ||
} | ||
const convertedRest = (0, _rest.default)(path); | ||
const convertedParams = (0, _params.default)(path, loose); | ||
const convertedParams = (0, _params.default)(path, ignoreFunctionLength); | ||
@@ -40,0 +43,0 @@ if (convertedRest || convertedParams) { |
@@ -47,3 +47,3 @@ "use strict"; | ||
function convertFunctionParams(path, loose, shouldTransformParam, replaceRestElement) { | ||
function convertFunctionParams(path, ignoreFunctionLength, shouldTransformParam, replaceRestElement) { | ||
const params = path.get("params"); | ||
@@ -123,3 +123,3 @@ const isSimpleParameterList = params.every(param => param.isIdentifier()); | ||
if (paramIsAssignmentPattern && (loose || node.kind === "set")) { | ||
if (paramIsAssignmentPattern && (ignoreFunctionLength || node.kind === "set")) { | ||
const left = param.get("left"); | ||
@@ -126,0 +126,0 @@ const right = param.get("right"); |
{ | ||
"name": "@babel/plugin-transform-parameters", | ||
"version": "7.12.13", | ||
"version": "7.13.0", | ||
"description": "Compile ES2015 default and rest parameters to ES5", | ||
@@ -17,3 +17,3 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^7.12.13" | ||
"@babel/helper-plugin-utils": "^7.13.0" | ||
}, | ||
@@ -27,5 +27,5 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "7.12.13", | ||
"@babel/core": "7.13.0", | ||
"@babel/helper-plugin-test-runner": "7.12.13" | ||
} | ||
} |
17937
466