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.12 to 1.0.0-beta.13

36

lib/index.js

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

var MAP_STYLED_VARS = {};
var cssList = [];
var MAP_CSS_LIST = {}; // let cssList = [];
var emotionStyledImportDeclaration = buildImport();

@@ -93,2 +94,9 @@ var emotionReactImportDeclaration = buildImportEmotionReact();

*/
var cssListKeys = Object.keys(MAP_CSS_LIST);
var cssList = cssListKeys.map(function (key) {
return {
name: key,
path: MAP_CSS_LIST[key].path
};
});
filterTags = cssList.filter(function (c) {

@@ -107,3 +115,4 @@ return MAP_STYLED_VARS[c.name] === 1;

}
}); // console.log(">>>123", filterTags, MAP_STYLED_VARS);
}); // console.log(filterTags);
// console.log(">>>123", filterTags, MAP_STYLED_VARS);

@@ -115,2 +124,17 @@ if (filterTags.length) {

},
ArrowFunctionExpression: function ArrowFunctionExpression(path) {
var _path$node$body, _path$node$body2, _path$node$body2$tag;
/**
* Collects all emotion `css` calls
*/
if (((_path$node$body = path.node.body) === null || _path$node$body === void 0 ? void 0 : _path$node$body.type) === "TaggedTemplateExpression" && ((_path$node$body2 = path.node.body) === null || _path$node$body2 === void 0 ? void 0 : (_path$node$body2$tag = _path$node$body2.tag) === null || _path$node$body2$tag === void 0 ? void 0 : _path$node$body2$tag.name) === CSS_LOCAL_NAME) {
var _path$parent$id;
var cssVarName = path === null || path === void 0 ? void 0 : (_path$parent$id = path.parent.id) === null || _path$parent$id === void 0 ? void 0 : _path$parent$id.name;
MAP_CSS_LIST[cssVarName] = {
path: path
};
}
},
FunctionExpression: function FunctionExpression(path) {

@@ -123,8 +147,8 @@ var _path$scope$block$bod, _path$scope$block$bod2, _path$scope$block$bod3, _path$scope$block$bod4, _path$scope$block$bod5, _path$scope$block$bod6, _path$scope$block$bod7;

if (((_path$scope$block$bod = path.scope.block.body) === null || _path$scope$block$bod === void 0 ? void 0 : (_path$scope$block$bod2 = _path$scope$block$bod.body[0]) === null || _path$scope$block$bod2 === void 0 ? void 0 : (_path$scope$block$bod3 = _path$scope$block$bod2.argument) === null || _path$scope$block$bod3 === void 0 ? void 0 : _path$scope$block$bod3.type) === "TaggedTemplateExpression" && ((_path$scope$block$bod4 = path.scope.block.body) === null || _path$scope$block$bod4 === void 0 ? void 0 : (_path$scope$block$bod5 = _path$scope$block$bod4.body[0]) === null || _path$scope$block$bod5 === void 0 ? void 0 : (_path$scope$block$bod6 = _path$scope$block$bod5.argument) === null || _path$scope$block$bod6 === void 0 ? void 0 : (_path$scope$block$bod7 = _path$scope$block$bod6.tag) === null || _path$scope$block$bod7 === void 0 ? void 0 : _path$scope$block$bod7.name) === CSS_LOCAL_NAME) {
var _path$parent$id;
var _path$parent$id2;
cssList.push({
name: path === null || path === void 0 ? void 0 : (_path$parent$id = path.parent.id) === null || _path$parent$id === void 0 ? void 0 : _path$parent$id.name,
var cssVarName = path === null || path === void 0 ? void 0 : (_path$parent$id2 = path.parent.id) === null || _path$parent$id2 === void 0 ? void 0 : _path$parent$id2.name;
MAP_CSS_LIST[cssVarName] = {
path: path
});
};
}

@@ -131,0 +155,0 @@ },

2

package.json
{
"name": "babel-plugin-emotion-rename",
"version": "1.0.0-beta.12",
"version": "1.0.0-beta.13",
"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