babel-plugin-emotion
Advanced tools
Comparing version 10.0.2 to 10.0.3
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93932
2437
320
+ Added@emotion/hash@0.8.0(transitive)
+ Added@emotion/memoize@0.7.4(transitive)
+ Added@emotion/serialize@0.11.16(transitive)
+ Added@emotion/unitless@0.7.5(transitive)
+ Added@emotion/utils@0.11.3(transitive)
- Removed@emotion/serialize@0.11.0(transitive)
- Removed@emotion/unitless@0.7.3(transitive)
- Removed@emotion/utils@0.11.1(transitive)
Updated@emotion/serialize@^0.11.1