Socket
Socket
Sign inDemoInstall

babel-plugin-emotion

Package Overview
Dependencies
Maintainers
2
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-emotion - npm Package Compare versions

Comparing version 10.0.2 to 10.0.3

8

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

@@ -477,7 +477,7 @@ 'use strict';

if (optionsArgument) {
if (!t.isObjectExpression(optionsArgument)) {
return t.callExpression(state.file.addHelper('extends'), [t.objectExpression([]), t.objectExpression(properties), optionsArgument]);
if (t.isObjectExpression(optionsArgument)) {
properties.unshift.apply(properties, optionsArgument.properties);
} else {
console.warn("Second argument to a styled call is not an object, it's going to be removed.");
}
properties.unshift.apply(properties, optionsArgument.properties);
}

@@ -484,0 +484,0 @@

@@ -409,12 +409,11 @@ "use strict";

optionsArgument = 2 <= args.length ? args[1] : null;
if (optionsArgument) {
if (!t.isObjectExpression(optionsArgument))
return t.callExpression(state.file.addHelper("extends"), [
t.objectExpression([]),
t.objectExpression(properties),
optionsArgument
]);
properties.unshift.apply(properties, optionsArgument.properties);
}
return t.objectExpression(properties);
return (
optionsArgument &&
(t.isObjectExpression(optionsArgument)
? properties.unshift.apply(properties, optionsArgument.properties)
: console.warn(
"Second argument to a styled call is not an object, it's going to be removed."
)),
t.objectExpression(properties)
);
},

@@ -421,0 +420,0 @@ createEmotionMacro = function(instancePath) {

{
"name": "babel-plugin-emotion",
"version": "10.0.2",
"version": "10.0.3",
"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.0",
"@emotion/serialize": "^0.11.1",
"babel-plugin-macros": "^2.0.0",

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

@@ -227,2 +227,3 @@ # babel-plugin-emotion

- `[filename]` - name of the file (without extension) where `css` or `styled` expression is located.
- `[dirname]` - name of the directory containing the file where `css` or `styled` expression is located.

@@ -229,0 +230,0 @@ This format only affects the label property of the expression, meaning that the `css` prefix and hash will

@@ -14,5 +14,6 @@ // @flow

const parsedPath = nodePath.parse(filename)
let localDirname = nodePath.basename(parsedPath.dir)
let localFilename = parsedPath.name
if (localFilename === 'index') {
localFilename = nodePath.basename(parsedPath.dir)
localFilename = localDirname
}

@@ -24,2 +25,3 @@ localFilename = localFilename.replace('.', '-')

.replace(/\[filename\]/gi, localFilename)
.replace(/\[dirname\]/gi, localDirname)
}

@@ -26,0 +28,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