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

babel-plugin-transform-es2015-typeof-symbol

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-es2015-typeof-symbol - npm Package Compare versions

Comparing version 6.0.15 to 6.1.2

23

lib/index.js
"use strict";
var _Symbol = require("babel-runtime/core-js/symbol")["default"];
exports.__esModule = true;

@@ -8,2 +10,4 @@

var IGNORE = _Symbol();
return {

@@ -15,3 +19,6 @@ visitor: {

if (node._ignoreSpecSymbols) return;
if (node[IGNORE]) return;
if (path.find(function (path) {
return !!path.node._generated;
})) return;

@@ -31,3 +38,3 @@ if (path.parentPath.isBinaryExpression() && t.EQUALITY_BINARY_OPERATORS.indexOf(parent.operator) >= 0) {

var unary = t.unaryExpression("typeof", node.argument);
unary._ignoreSpecSymbols = true;
unary[IGNORE] = true;
path.replaceWith(t.conditionalExpression(t.binaryExpression("===", unary, undefLiteral), undefLiteral, call));

@@ -38,14 +45,2 @@ } else {

}
},
BinaryExpression: function BinaryExpression(path) {
var node = path.node;
if (node.operator === "instanceof") {
path.replaceWith(t.callExpression(this.addHelper("instanceof"), [node.left, node.right]));
}
},
"VariableDeclaration|FunctionDeclaration": function VariableDeclarationFunctionDeclaration(path) {
if (path.node._generated) path.skip();
}

@@ -52,0 +47,0 @@ }

{
"name": "babel-plugin-transform-es2015-typeof-symbol",
"version": "6.0.15",
"version": "6.1.2",
"description": "",

@@ -5,0 +5,0 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-typeof-symbol",

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