@babel/plugin-proposal-pipeline-operator
Advanced tools
Comparing version 7.0.0-beta.31 to 7.0.0-beta.32
@@ -8,6 +8,7 @@ "use strict"; | ||
var _core = require("@babel/core"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _default(_ref) { | ||
var t = _ref.types; | ||
function _default() { | ||
return { | ||
@@ -23,3 +24,5 @@ inherits: _pluginSyntaxPipelineOperator.default, | ||
if (operator !== "|>") return; | ||
var optimizeArrow = t.isArrowFunctionExpression(right) && t.isExpression(right.body); | ||
var optimizeArrow = _core.types.isArrowFunctionExpression(right) && _core.types.isExpression(right.body); | ||
var param; | ||
@@ -31,3 +34,3 @@ | ||
if (params.length === 1 && t.isIdentifier(params[0])) { | ||
if (params.length === 1 && _core.types.isIdentifier(params[0])) { | ||
param = params[0]; | ||
@@ -37,10 +40,10 @@ } else if (params.length > 0) { | ||
} | ||
} else if (t.isIdentifier(right, { | ||
} else if (_core.types.isIdentifier(right, { | ||
name: "eval" | ||
})) { | ||
right = t.sequenceExpression([t.numericLiteral(0), right]); | ||
right = _core.types.sequenceExpression([_core.types.numericLiteral(0), right]); | ||
} | ||
if (optimizeArrow && !param) { | ||
path.replaceWith(t.sequenceExpression([left, right.body])); | ||
path.replaceWith(_core.types.sequenceExpression([left, right.body])); | ||
return; | ||
@@ -58,4 +61,4 @@ } | ||
var call = optimizeArrow ? right.body : t.callExpression(right, [placeholder]); | ||
path.replaceWith(t.sequenceExpression([t.assignmentExpression("=", placeholder, left), call])); | ||
var call = optimizeArrow ? right.body : _core.types.callExpression(right, [placeholder]); | ||
path.replaceWith(_core.types.sequenceExpression([_core.types.assignmentExpression("=", placeholder, left), call])); | ||
} | ||
@@ -62,0 +65,0 @@ } |
{ | ||
"name": "@babel/plugin-proposal-pipeline-operator", | ||
"version": "7.0.0-beta.31", | ||
"version": "7.0.0-beta.32", | ||
"description": "Transform pipeline operator into call expressions", | ||
@@ -12,11 +12,11 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-pipeline-operator", | ||
"dependencies": { | ||
"@babel/plugin-syntax-pipeline-operator": "7.0.0-beta.31" | ||
"@babel/plugin-syntax-pipeline-operator": "7.0.0-beta.32" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "7.0.0-beta.31" | ||
"@babel/core": "7.0.0-beta.32" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.31", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.31" | ||
"@babel/core": "7.0.0-beta.32", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.32" | ||
} | ||
} |
import syntaxPipelineOperator from "@babel/plugin-syntax-pipeline-operator"; | ||
import { types as t } from "@babel/core"; | ||
export default function({ types: t }) { | ||
export default function() { | ||
return { | ||
@@ -5,0 +6,0 @@ inherits: syntaxPipelineOperator, |
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
10144
311
+ Added@babel/code-frame@7.0.0-beta.32(transitive)
+ Added@babel/core@7.0.0-beta.32(transitive)
+ Added@babel/generator@7.0.0-beta.32(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.32(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.32(transitive)
+ Added@babel/helpers@7.0.0-beta.32(transitive)
+ Added@babel/plugin-syntax-pipeline-operator@7.0.0-beta.32(transitive)
+ Added@babel/template@7.0.0-beta.32(transitive)
+ Added@babel/traverse@7.0.0-beta.32(transitive)
+ Added@babel/types@7.0.0-beta.32(transitive)
+ Addedbabylon@7.0.0-beta.32(transitive)
- Removed@babel/code-frame@7.0.0-beta.31(transitive)
- Removed@babel/core@7.0.0-beta.31(transitive)
- Removed@babel/generator@7.0.0-beta.31(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.31(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.31(transitive)
- Removed@babel/helpers@7.0.0-beta.31(transitive)
- Removed@babel/plugin-syntax-pipeline-operator@7.0.0-beta.31(transitive)
- Removed@babel/template@7.0.0-beta.31(transitive)
- Removed@babel/traverse@7.0.0-beta.31(transitive)
- Removed@babel/types@7.0.0-beta.31(transitive)
- Removedbabylon@7.0.0-beta.31(transitive)