Socket
Socket
Sign inDemoInstall

babel-plugin-emotion

Package Overview
Dependencies
38
Maintainers
2
Versions
90
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 10.0.8 to 10.0.9

39

dist/babel-plugin-emotion.cjs.dev.js

@@ -192,2 +192,3 @@ 'use strict';

}
var pascalCaseRegex = /^[A-Z][A-Za-z]+/;

@@ -197,5 +198,41 @@ function getDeclaratorName(path, t) {

var parent = path.findParent(function (p) {
return p.isVariableDeclarator() || p.isFunctionDeclaration() || p.isFunctionExpression() || p.isArrowFunctionExpression();
});
if (!parent) {
return '';
}
if (parent.isVariableDeclarator()) {
// we probably have a css call assigned to a variable
// so we'll just return the variable name
return parent.node.id.name;
} // we probably have an inline css prop usage
if (parent.isFunctionDeclaration()) {
var _name = parent.node.id.name;
if (pascalCaseRegex.test(_name)) {
return _name;
}
return '';
}
var variableDeclarator = path.findParent(function (p) {
return p.isVariableDeclarator();
});
return parent && t.isIdentifier(parent.node.id) ? parent.node.id.name : '';
if (!variableDeclarator) {
return '';
}
var name = variableDeclarator.node.id.name;
if (pascalCaseRegex.test(name)) {
return name;
}
return '';
}

@@ -202,0 +239,0 @@

@@ -156,7 +156,24 @@ "use strict";

}
var pascalCaseRegex = /^[A-Z][A-Za-z]+/;
function getDeclaratorName(path, t) {
var parent = path.findParent(function(p) {
return (
p.isVariableDeclarator() ||
p.isFunctionDeclaration() ||
p.isFunctionExpression() ||
p.isArrowFunctionExpression()
);
});
if (!parent) return "";
if (parent.isVariableDeclarator()) return parent.node.id.name;
if (parent.isFunctionDeclaration()) {
var _name = parent.node.id.name;
return pascalCaseRegex.test(_name) ? _name : "";
}
var variableDeclarator = path.findParent(function(p) {
return p.isVariableDeclarator();
});
return parent && t.isIdentifier(parent.node.id) ? parent.node.id.name : "";
if (!variableDeclarator) return "";
var name = variableDeclarator.node.id.name;
return pascalCaseRegex.test(name) ? name : "";
}

@@ -163,0 +180,0 @@ function getIdentifierName(path, t) {

4

package.json
{
"name": "babel-plugin-emotion",
"version": "10.0.8",
"version": "10.0.9",
"description": "A recommended babel preprocessing plugin for emotion, The Next Generation of CSS-in-JS.",

@@ -15,3 +15,3 @@ "main": "dist/babel-plugin-emotion.cjs.js",

"@emotion/memoize": "0.7.1",
"@emotion/serialize": "^0.11.5",
"@emotion/serialize": "^0.11.6",
"babel-plugin-macros": "^2.0.0",

@@ -18,0 +18,0 @@ "babel-plugin-syntax-jsx": "^6.18.0",

@@ -187,3 +187,2 @@ // @flow

let expressionPath = path.get('value.expression')
let sourceMap =

@@ -190,0 +189,0 @@ state.emotionSourceMap && path.node.loc !== undefined

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