@babel/plugin-transform-react-inline-elements
Advanced tools
Comparing version 7.21.4-esm.4 to 7.22.5
@@ -1,5 +0,11 @@ | ||
import { declare } from "@babel/helper-plugin-utils"; | ||
import helper from "@babel/helper-builder-react-jsx"; | ||
import { types as t } from "@babel/core"; | ||
export default declare(api => { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _helperPluginUtils = require("@babel/helper-plugin-utils"); | ||
var _helperBuilderReactJsx = require("@babel/helper-builder-react-jsx"); | ||
var _core = require("@babel/core"); | ||
var _default = (0, _helperPluginUtils.declare)(api => { | ||
api.assertVersion(7); | ||
@@ -9,3 +15,3 @@ function hasRefOrSpread(attrs) { | ||
const attr = attrs[i]; | ||
if (t.isJSXSpreadAttribute(attr)) return true; | ||
if (_core.types.isJSXSpreadAttribute(attr)) return true; | ||
if (isJSXAttributeOfName(attr, "ref")) return true; | ||
@@ -16,7 +22,7 @@ } | ||
function isJSXAttributeOfName(attr, name) { | ||
return t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, { | ||
return _core.types.isJSXAttribute(attr) && _core.types.isJSXIdentifier(attr.name, { | ||
name: name | ||
}); | ||
} | ||
const visitor = helper({ | ||
const visitor = (0, _helperBuilderReactJsx.default)({ | ||
filter(node) { | ||
@@ -28,4 +34,4 @@ return node.type === "JSXElement" && !hasRefOrSpread(node.openingElement.attributes); | ||
const args = state.args; | ||
if (t.react.isCompatTag(tagName)) { | ||
args.push(t.stringLiteral(tagName)); | ||
if (_core.types.react.isCompatTag(tagName)) { | ||
args.push(_core.types.stringLiteral(tagName)); | ||
} else { | ||
@@ -39,4 +45,4 @@ args.push(state.tagExpr); | ||
let hasKey = false; | ||
if (t.isObjectExpression(props)) { | ||
const keyIndex = props.properties.findIndex(prop => t.isIdentifier(prop.key, { | ||
if (_core.types.isObjectExpression(props)) { | ||
const keyIndex = props.properties.findIndex(prop => _core.types.isIdentifier(prop.key, { | ||
name: "key" | ||
@@ -49,7 +55,7 @@ })); | ||
} | ||
} else if (t.isNullLiteral(props)) { | ||
state.args.splice(1, 1, t.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, t.unaryExpression("void", t.numericLiteral(0))); | ||
state.args.splice(2, 0, _core.types.unaryExpression("void", _core.types.numericLiteral(0))); | ||
} | ||
@@ -64,3 +70,4 @@ state.pure = true; | ||
}); | ||
exports.default = _default; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@babel/plugin-transform-react-inline-elements", | ||
"version": "7.21.4-esm.4", | ||
"version": "7.22.5", | ||
"description": "Turn JSX elements into exploded React objects", | ||
@@ -20,11 +20,11 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-builder-react-jsx": "7.21.4-esm.4", | ||
"@babel/helper-plugin-utils": "7.21.4-esm.4" | ||
"@babel/helper-builder-react-jsx": "^7.22.5", | ||
"@babel/helper-plugin-utils": "^7.22.5" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "^7.0.0-0 || ^7.21.4-esm.2" | ||
"@babel/core": "^7.0.0-0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.21.4-esm.4", | ||
"@babel/helper-plugin-test-runner": "7.21.4-esm.4" | ||
"@babel/core": "^7.22.5", | ||
"@babel/helper-plugin-test-runner": "^7.22.5" | ||
}, | ||
@@ -35,3 +35,3 @@ "engines": { | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
"type": "module" | ||
"type": "commonjs" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10115
65
0
5
No
+ Added@babel/helper-annotate-as-pure@7.25.9(transitive)
+ Added@babel/helper-builder-react-jsx@7.25.9(transitive)
+ Added@babel/helper-plugin-utils@7.25.9(transitive)
- Removed@babel/helper-annotate-as-pure@7.21.4-esm.4(transitive)
- Removed@babel/helper-builder-react-jsx@7.21.4-esm.4(transitive)
- Removed@babel/helper-plugin-utils@7.21.4-esm.4(transitive)
- Removed@babel/helper-string-parser@7.21.4-esm.4(transitive)
- Removed@babel/helper-validator-identifier@7.21.4-esm.4(transitive)
- Removed@babel/types@7.21.4-esm.4(transitive)
- Removedto-fast-properties@2.0.0(transitive)