Socket
Socket
Sign inDemoInstall

babel-plugin-emotion-rename

Package Overview
Dependencies
17
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-beta.19 to 1.0.0-beta.20

33

lib/index.js

@@ -72,3 +72,4 @@ "use strict";

name: key,
path: MAP_CSS_LIST[key].path
path: MAP_CSS_LIST[key].path,
_type: MAP_CSS_LIST[key]._type
};

@@ -81,2 +82,6 @@ });

var _t$path$scope$block$b, _t$path$scope$block$b2;
if (t._type === "callee") {
t.path.node.callee.name = "css2";
return;
}
if ((_t$path$scope$block$b = t.path.scope.block.body.body[0]) !== null && _t$path$scope$block$b !== void 0 && _t$path$scope$block$b.argument.tag) {

@@ -140,2 +145,7 @@ t.path.scope.block.body.body[0].argument.tag.name = "css2";

var _path$node$tag$object;
// if (path.node.tag?.name === CSS_LOCAL_NAME) {
// if (path?.parent?.id?.type === "Identifier") {
// MAP_CSS_LIST[path?.parent?.id.name] = 1;
// }
// }
if (((_path$node$tag$object = path.node.tag.object) === null || _path$node$tag$object === void 0 ? void 0 : _path$node$tag$object.name) === STYLED_LOCAL_NAME) {

@@ -229,2 +239,23 @@ path.node.quasi.expressions.map(function (exp) {

}
if (path.node.callee.name === CSS_LOCAL_NAME && path.node.arguments && path.node.arguments.length) {
var _path$parent, _path$parent$id3;
if (((_path$parent = path.parent) === null || _path$parent === void 0 ? void 0 : (_path$parent$id3 = _path$parent.id) === null || _path$parent$id3 === void 0 ? void 0 : _path$parent$id3.type) === "Identifier") {
var _path$parent2, _path$parent2$id;
MAP_CSS_LIST[(_path$parent2 = path.parent) === null || _path$parent2 === void 0 ? void 0 : (_path$parent2$id = _path$parent2.id) === null || _path$parent2$id === void 0 ? void 0 : _path$parent2$id.name] = {
_type: "callee",
path: path
};
}
path.node.arguments.filter(function (a) {
return a.type === "Identifier";
}).map(function (a) {
return a.name;
}).forEach(function (expName) {
if (MAP_CSS_LIST[expName]) {
MAP_STYLED_VARS[expName] = 1;
console.log("css within css --->", expName);
}
});
return;
}
REP.forEach(function (_ref2) {

@@ -231,0 +262,0 @@ var original = _ref2.original;

2

package.json
{
"name": "babel-plugin-emotion-rename",
"version": "1.0.0-beta.19",
"version": "1.0.0-beta.20",
"description": "Babel plugin to rename old Emotion 9 import to new Emotion 10+ import",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc