Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-react-cssmoduleify

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-react-cssmoduleify - npm Package Compare versions

Comparing version 1.0.0-beta.7 to 1.0.0-beta.8

8

lib/index.js

@@ -84,2 +84,6 @@ "use strict";

var maybeCSSModuleExpression = function maybeCSSModuleExpression(node, cssmodule) {
return t.logicalExpression("||", t.memberExpression(cssmodule, node, true), node);
};
var computeClassName = function computeClassName(value, cssmodule) {

@@ -153,3 +157,3 @@ if (t.isStringLiteral(value)) {

if (t.isIdentifier(arrayExpressionPath)) {
arrayExpressionPath.parent.object = t.callExpression(t.memberExpression(arrayExpressionPath.node, t.identifier("map"), false), [t.arrowFunctionExpression([t.identifier("i")], t.memberExpression(cssmodule, t.identifier("i"), true))]);
arrayExpressionPath.parent.object = t.callExpression(t.memberExpression(arrayExpressionPath.node, t.identifier("map"), false), [t.arrowFunctionExpression([t.identifier("i")], maybeCSSModuleExpression(t.identifier("i"), cssmodule))]);
return;

@@ -222,3 +226,3 @@ }

// this is just mean
callExpression.replaceWith(t.callExpression(t.memberExpression(t.callExpression(t.memberExpression(t.callExpression(t.memberExpression(callExpression.node, t.identifier("split"), false), [t.stringLiteral(" ")]), t.identifier("map")), [t.arrowFunctionExpression([t.identifier("i")], t.memberExpression(cssmodule, t.identifier("i"), true))]), t.identifier("join"), false), [t.stringLiteral(" ")]));
callExpression.replaceWith(t.callExpression(t.memberExpression(t.callExpression(t.memberExpression(t.callExpression(t.memberExpression(callExpression.node, t.identifier("split"), false), [t.stringLiteral(" ")]), t.identifier("map")), [t.arrowFunctionExpression([t.identifier("i")], maybeCSSModuleExpression(t.identifier("i"), cssmodule))]), t.identifier("join"), false), [t.stringLiteral(" ")]));
};

@@ -225,0 +229,0 @@

{
"name": "babel-plugin-react-cssmoduleify",
"version": "1.0.0-beta.7",
"version": "1.0.0-beta.8",
"description": "Babel plugin to transform traditional classNames to CSS Modules",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -86,2 +86,9 @@ /* eslint no-extra-parens: 0 */

const maybeCSSModuleExpression = (node, cssmodule) =>
t.logicalExpression(
"||",
t.memberExpression(cssmodule, node, true),
node
);
const computeClassName = (value, cssmodule) => {

@@ -173,3 +180,3 @@ if (t.isStringLiteral(value)) {

[t.identifier("i")],
t.memberExpression(cssmodule, t.identifier("i"), true)
maybeCSSModuleExpression(t.identifier("i"), cssmodule)
)]

@@ -256,3 +263,3 @@ );

[t.identifier("i")],
t.memberExpression(cssmodule, t.identifier("i"), true)
maybeCSSModuleExpression(t.identifier("i"), cssmodule)
)]

@@ -259,0 +266,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