@babel/plugin-transform-react-inline-elements
Advanced tools
Comparing version 7.2.0 to 7.7.4
@@ -8,35 +8,11 @@ "use strict"; | ||
function _helperPluginUtils() { | ||
const data = require("@babel/helper-plugin-utils"); | ||
var _helperPluginUtils = require("@babel/helper-plugin-utils"); | ||
_helperPluginUtils = function () { | ||
return data; | ||
}; | ||
var _helperBuilderReactJsx = _interopRequireDefault(require("@babel/helper-builder-react-jsx")); | ||
return data; | ||
} | ||
var _core = require("@babel/core"); | ||
function _helperBuilderReactJsx() { | ||
const data = _interopRequireDefault(require("@babel/helper-builder-react-jsx")); | ||
_helperBuilderReactJsx = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _core() { | ||
const data = require("@babel/core"); | ||
_core = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _default = (0, _helperPluginUtils().declare)(api => { | ||
var _default = (0, _helperPluginUtils.declare)(api => { | ||
api.assertVersion(7); | ||
@@ -47,3 +23,3 @@ | ||
const attr = attrs[i]; | ||
if (_core().types.isJSXSpreadAttribute(attr)) return true; | ||
if (_core.types.isJSXSpreadAttribute(attr)) return true; | ||
if (isJSXAttributeOfName(attr, "ref")) return true; | ||
@@ -56,3 +32,3 @@ } | ||
function isJSXAttributeOfName(attr, name) { | ||
return _core().types.isJSXAttribute(attr) && _core().types.isJSXIdentifier(attr.name, { | ||
return _core.types.isJSXAttribute(attr) && _core.types.isJSXIdentifier(attr.name, { | ||
name: name | ||
@@ -62,3 +38,3 @@ }); | ||
const visitor = (0, _helperBuilderReactJsx().default)({ | ||
const visitor = (0, _helperBuilderReactJsx.default)({ | ||
filter(node) { | ||
@@ -72,4 +48,4 @@ return node.openingElement && !hasRefOrSpread(node.openingElement.attributes); | ||
if (_core().types.react.isCompatTag(tagName)) { | ||
args.push(_core().types.stringLiteral(tagName)); | ||
if (_core.types.react.isCompatTag(tagName)) { | ||
args.push(_core.types.stringLiteral(tagName)); | ||
} else { | ||
@@ -85,4 +61,4 @@ args.push(state.tagExpr); | ||
if (_core().types.isObjectExpression(props)) { | ||
const keyIndex = props.properties.findIndex(prop => _core().types.isIdentifier(prop.key, { | ||
if (_core.types.isObjectExpression(props)) { | ||
const keyIndex = props.properties.findIndex(prop => _core.types.isIdentifier(prop.key, { | ||
name: "key" | ||
@@ -96,8 +72,8 @@ })); | ||
} | ||
} else if (_core().types.isNullLiteral(props)) { | ||
state.args.splice(1, 1, _core().types.objectExpression([])); | ||
} else if (_core.types.isNullLiteral(props)) { | ||
state.args.splice(1, 1, _core.types.objectExpression([])); | ||
} | ||
if (!hasKey && state.args.length > 2) { | ||
state.args.splice(2, 0, _core().types.unaryExpression("void", _core().types.numericLiteral(0))); | ||
state.args.splice(2, 0, _core.types.unaryExpression("void", _core.types.numericLiteral(0))); | ||
} | ||
@@ -104,0 +80,0 @@ } |
{ | ||
"name": "@babel/plugin-transform-react-inline-elements", | ||
"version": "7.2.0", | ||
"version": "7.7.4", | ||
"description": "Turn JSX elements into exploded React objects", | ||
@@ -15,3 +15,3 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-inline-elements", | ||
"dependencies": { | ||
"@babel/helper-builder-react-jsx": "^7.0.0", | ||
"@babel/helper-builder-react-jsx": "^7.7.4", | ||
"@babel/helper-plugin-utils": "^7.0.0" | ||
@@ -23,5 +23,6 @@ }, | ||
"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
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
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
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
0
4537
63