New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-react-inline-elements

Package Overview
Dependencies
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-react-inline-elements - npm Package Compare versions

Comparing version 7.0.0-alpha.15 to 7.0.0-alpha.16

25

lib/index.js

@@ -14,2 +14,3 @@ "use strict";

}
return false;

@@ -19,3 +20,5 @@ }

function isJSXAttributeOfName(attr, name) {
return t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, { name: name });
return t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, {
name: name
});
}

@@ -25,3 +28,3 @@

var value = attr.value;
if (!value) return t.identifier("true");
if (!value) return t.booleanLiteral(true);
if (t.isJSXExpressionContainer(value)) value = value.expression;

@@ -35,6 +38,4 @@ return value;

var node = path.node;
var open = node.openingElement;
if (hasRefOrSpread(open.attributes)) return;
var props = t.objectExpression([]);

@@ -52,16 +53,7 @@ var key = null;

for (var _iterator = open.attributes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref2;
var _arr = open.attributes;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref2 = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref2 = _i.value;
}
for (var _i = 0; _i < _arr.length; _i++) {
var attr = _arr[_i];
var attr = _ref2;
if (isJSXAttributeOfName(attr, "key")) {

@@ -77,2 +69,3 @@ key = getAttributeValue(attr);

var args = [type, props];
if (key || node.children.length) {

@@ -79,0 +72,0 @@ var children = t.react.buildChildren(node);

{
"name": "babel-plugin-transform-react-inline-elements",
"version": "7.0.0-alpha.15",
"version": "7.0.0-alpha.16",
"description": "Turn JSX elements into exploded React objects",

@@ -12,4 +12,4 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-inline-elements",

"devDependencies": {
"babel-helper-plugin-test-runner": "7.0.0-alpha.15"
"babel-helper-plugin-test-runner": "7.0.0-alpha.16"
}
}
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