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

babel-plugin-styletron

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-styletron - npm Package Compare versions

Comparing version 2.0.0-beta.2 to 2.0.0-beta.4

24

lib/index.js

@@ -6,12 +6,16 @@ module.exports = function (ref) {

visitor: {
JSXAttribute: function JSXAttribute(path) {
if (path.node.name.name === 'style') {
path.node.name.name = 'className';
path.node.value = t.JSXExpressionContainer(
t.CallExpression(
t.MemberExpression(
t.Identifier('Styletron'),
t.Identifier('injectStyles')),
[t.Identifier('styletron'), path.node.value.expression])
);
JSXElement: {
enter: function enter(path) {
path.node.openingElement.attributes.forEach(function (node) {
if (node.name.name === 'style') {
node.name.name = 'className';
node.value = t.JSXExpressionContainer(
t.CallExpression(
t.MemberExpression(
t.Identifier('Styletron'),
t.Identifier('injectStyles')),
[t.Identifier('styletron'), node.value.expression])
);
}
});
}

@@ -18,0 +22,0 @@ }

{
"name": "babel-plugin-styletron",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.4",
"description": "A universal stylesheet manager for node.js and browsers",

@@ -5,0 +5,0 @@ "author": "Ryan Tsao <ryan.j.tsao@gmail.com>",

module.exports = function ({types: t}) {
return {
visitor: {
JSXAttribute(path) {
if (path.node.name.name === 'style') {
path.node.name.name = 'className';
path.node.value = t.JSXExpressionContainer(
t.CallExpression(
t.MemberExpression(
t.Identifier('Styletron'),
t.Identifier('injectStyles')),
[t.Identifier('styletron'), path.node.value.expression])
);
JSXElement: {
enter(path) {
path.node.openingElement.attributes.forEach(node => {
if (node.name.name === 'style') {
node.name.name = 'className';
node.value = t.JSXExpressionContainer(
t.CallExpression(
t.MemberExpression(
t.Identifier('Styletron'),
t.Identifier('injectStyles')),
[t.Identifier('styletron'), node.value.expression])
);
}
});
}

@@ -15,0 +19,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