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

babel-plugin-transform-jsx-stylesheet

Package Overview
Dependencies
Maintainers
5
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-jsx-stylesheet - npm Package Compare versions

Comparing version 0.6.7 to 0.6.8-0

11

lib/index.js

@@ -171,7 +171,14 @@ "use strict";

} else {
styleAttribute.value.expression = t.arrayExpression(arrayExpression.concat(expression));
var mergeArrayExpression = arrayExpression.concat(expression);
mergeArrayExpression.unshift(t.objectExpression([]));
styleAttribute.value.expression = t.callExpression(t.memberExpression(t.identifier('Object'), t.identifier('assign')), mergeArrayExpression);
}
} else {
var _expression = arrayExpression.length === 1 ? arrayExpression[0] : t.arrayExpression(arrayExpression);
if (arrayExpression.length > 1) {
// Object.assign({}, ...)
arrayExpression.unshift(t.objectExpression([]));
}
var _expression = arrayExpression.length === 1 ? arrayExpression[0] : t.callExpression(t.memberExpression(t.identifier('Object'), t.identifier('assign')), arrayExpression);
attributes.push(t.jSXAttribute(t.jSXIdentifier('style'), t.jSXExpressionContainer(_expression)));

@@ -178,0 +185,0 @@ }

2

package.json
{
"name": "babel-plugin-transform-jsx-stylesheet",
"version": "0.6.7",
"version": "0.6.8-0",
"description": "Transform stylesheet selector to style in JSX Elements.",

@@ -5,0 +5,0 @@ "license": "BSD-3-Clause",

@@ -116,3 +116,3 @@ import jSXStylePlugin from '../index';

render() {
return <div style={[_styleSheet["header1"], _styleSheet["header2"]]} />;
return <div style={Object.assign({}, _styleSheet["header1"], _styleSheet["header2"])} />;
}

@@ -178,3 +178,3 @@ }`);

render() {
return <div style={[_styleSheet["header2"], styles.header1]} />;
return <div style={Object.assign({}, _styleSheet["header2"], styles.header1)} />;
}

@@ -202,5 +202,5 @@ }`);

render() {
return <div style={[_styleSheet["header"], {
return <div style={Object.assign({}, _styleSheet["header"], {
height: 100
}]} />;
})} />;
}

@@ -207,0 +207,0 @@ }`);

@@ -180,3 +180,2 @@ import path from 'path';

if (hasClassName) {

@@ -223,6 +222,20 @@ // Dont remove className

} else {
styleAttribute.value.expression = t.arrayExpression(arrayExpression.concat(expression));
const mergeArrayExpression = arrayExpression.concat(expression);
mergeArrayExpression.unshift(t.objectExpression([]));
styleAttribute.value.expression = t.callExpression(
t.memberExpression(t.identifier('Object'), t.identifier('assign')),
mergeArrayExpression
);
}
} else {
let expression = arrayExpression.length === 1 ? arrayExpression[0] : t.arrayExpression(arrayExpression);
if (arrayExpression.length > 1) {
// Object.assign({}, ...)
arrayExpression.unshift(t.objectExpression([]));
}
let expression = arrayExpression.length === 1 ?
arrayExpression[0] :
t.callExpression(
t.memberExpression(t.identifier('Object'), t.identifier('assign')),
arrayExpression
);
attributes.push(t.jSXAttribute(t.jSXIdentifier('style'), t.jSXExpressionContainer(expression)));

@@ -229,0 +242,0 @@ }

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