@babel/plugin-transform-typeof-symbol
Advanced tools
Comparing version 7.2.0 to 7.7.4
@@ -8,23 +8,7 @@ "use strict"; | ||
function _helperPluginUtils() { | ||
const data = require("@babel/helper-plugin-utils"); | ||
var _helperPluginUtils = require("@babel/helper-plugin-utils"); | ||
_helperPluginUtils = function () { | ||
return data; | ||
}; | ||
var _core = require("@babel/core"); | ||
return data; | ||
} | ||
function _core() { | ||
const data = require("@babel/core"); | ||
_core = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
var _default = (0, _helperPluginUtils().declare)(api => { | ||
var _default = (0, _helperPluginUtils.declare)(api => { | ||
api.assertVersion(7); | ||
@@ -51,3 +35,3 @@ return { | ||
if (path.parentPath.isBinaryExpression() && _core().types.EQUALITY_BINARY_OPERATORS.indexOf(parent.operator) >= 0) { | ||
if (path.parentPath.isBinaryExpression() && _core.types.EQUALITY_BINARY_OPERATORS.indexOf(parent.operator) >= 0) { | ||
const opposite = path.getOpposite(); | ||
@@ -69,3 +53,3 @@ | ||
const call = _core().types.callExpression(helper, [node.argument]); | ||
const call = _core.types.callExpression(helper, [node.argument]); | ||
@@ -75,5 +59,5 @@ const arg = path.get("argument"); | ||
if (arg.isIdentifier() && !path.scope.hasBinding(arg.node.name, true)) { | ||
const unary = _core().types.unaryExpression("typeof", _core().types.cloneNode(node.argument)); | ||
const unary = _core.types.unaryExpression("typeof", _core.types.cloneNode(node.argument)); | ||
path.replaceWith(_core().types.conditionalExpression(_core().types.binaryExpression("===", unary, _core().types.stringLiteral("undefined")), _core().types.stringLiteral("undefined"), call)); | ||
path.replaceWith(_core.types.conditionalExpression(_core.types.binaryExpression("===", unary, _core.types.stringLiteral("undefined")), _core.types.stringLiteral("undefined"), call)); | ||
} else { | ||
@@ -80,0 +64,0 @@ path.replaceWith(call); |
{ | ||
"name": "@babel/plugin-transform-typeof-symbol", | ||
"version": "7.2.0", | ||
"version": "7.7.4", | ||
"description": "This transformer wraps all typeof expressions with a method that replicates native behaviour. (ie. returning “symbol” for symbols)", | ||
@@ -21,5 +21,6 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typeof-symbol", | ||
"devDependencies": { | ||
"@babel/core": "^7.2.0", | ||
"@babel/helper-plugin-test-runner": "^7.0.0" | ||
} | ||
"@babel/core": "^7.7.4", | ||
"@babel/helper-plugin-test-runner": "^7.7.4" | ||
}, | ||
"gitHead": "75767d87cb147709b9bd9b99bf44daa6688874a9" | ||
} |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
4294
51