Socket
Socket
Sign inDemoInstall

babel-plugin-emotion

Package Overview
Dependencies
52
Maintainers
2
Versions
90
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 10.0.7 to 10.0.8

4

package.json
{
"name": "babel-plugin-emotion",
"version": "10.0.7",
"version": "10.0.8",
"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.4",
"@emotion/serialize": "^0.11.5",
"babel-plugin-macros": "^2.0.0",

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

@@ -38,6 +38,41 @@ // @flow

let pascalCaseRegex = /^[A-Z][A-Za-z]+/
function getDeclaratorName(path, t) {
// $FlowFixMe
const parent = path.findParent(p => p.isVariableDeclarator())
return parent && t.isIdentifier(parent.node.id) ? parent.node.id.name : ''
const parent = path.findParent(
p =>
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()) {
let { name } = parent.node.id
if (pascalCaseRegex.test(name)) {
return name
}
return ''
}
let variableDeclarator = path.findParent(p => p.isVariableDeclarator())
if (!variableDeclarator) {
return ''
}
let { name } = variableDeclarator.node.id
if (pascalCaseRegex.test(name)) {
return name
}
return ''
}

@@ -44,0 +79,0 @@

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