Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/plugin-proposal-pipeline-operator

Package Overview
Dependencies
Maintainers
4
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-proposal-pipeline-operator - npm Package Compare versions

Comparing version 7.0.0-beta.31 to 7.0.0-beta.32

21

lib/index.js

@@ -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,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc