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.4 to 2.0.1-beta.0

fixtures/context.expected

2

lib/index.js

@@ -9,3 +9,3 @@ module.exports = function (ref) {

path.node.openingElement.attributes.forEach(function (node) {
if (node.name.name === 'style') {
if (node.name.name === 'style' && path.scope.hasBinding('styletron')) {
node.name.name = 'className';

@@ -12,0 +12,0 @@ node.value = t.JSXExpressionContainer(

@@ -10,3 +10,3 @@ var fs = require('fs');

test('basic', function (t) {
test('no styletron binding', function (t) {
var output = babel.transformFileSync(fixturesDir + '/basic.source', {

@@ -21,1 +21,12 @@ plugins: ['syntax-jsx', pluginPath]

});
test('styletron in context', function (t) {
var output = babel.transformFileSync(fixturesDir + '/context.source', {
plugins: ['syntax-jsx', pluginPath]
});
var expected = fs.readFileSync(fixturesDir + '/context.expected', 'utf-8');
t.equal(output.code.trim(), expected.trim(), 'output matches expected');
t.end();
});
{
"name": "babel-plugin-styletron",
"version": "2.0.0-beta.4",
"version": "2.0.1-beta.0",
"description": "A universal stylesheet manager for node.js and browsers",

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

@@ -7,3 +7,3 @@ module.exports = function ({types: t}) {

path.node.openingElement.attributes.forEach(node => {
if (node.name.name === 'style') {
if (node.name.name === 'style' && path.scope.hasBinding('styletron')) {
node.name.name = 'className';

@@ -10,0 +10,0 @@ node.value = t.JSXExpressionContainer(

@@ -10,3 +10,3 @@ const fs = require('fs');

test('basic', (t) => {
test('no styletron binding', (t) => {
var output = babel.transformFileSync(fixturesDir + '/basic.source', {

@@ -21,1 +21,12 @@ plugins: ['syntax-jsx', pluginPath]

});
test('styletron in context', (t) => {
var output = babel.transformFileSync(fixturesDir + '/context.source', {
plugins: ['syntax-jsx', pluginPath]
});
var expected = fs.readFileSync(fixturesDir + '/context.expected', 'utf-8');
t.equal(output.code.trim(), expected.trim(), 'output matches expected');
t.end();
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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