Socket
Socket
Sign inDemoInstall

babel-plugin-styled-components

Package Overview
Dependencies
Maintainers
3
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-styled-components - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

6

lib/utils/detectors.js

@@ -27,6 +27,6 @@ "use strict";

if (!bypassCache && cacheKey in localNameCache) {
return localNameCache[cacheKey]; // state.customImportName is injected by the babel macro
} else if (state.customImportName) {
if (state.customImportName && !localNameCache[cacheKey]) {
return state.customImportName.name;
} else if (!bypassCache && localNameCache[cacheKey]) {
return localNameCache[cacheKey];
}

@@ -33,0 +33,0 @@

@@ -48,6 +48,4 @@ "use strict";

if (path.node.name.name !== 'css') return;
const program = state.file.path; // state.customImportName is passed through from styled-components/macro if it's used
// since the macro also inserts the import
let importName = state.customImportName || (0, _detectors.importLocalName)('default', state);
const program = state.file.path;
let importName = (0, _detectors.importLocalName)('default', state);
const {

@@ -57,3 +55,3 @@ bindings

if (!importName || !bindings[importName.name] || !bindings[importName]) {
if (!importName) {
(0, _helperModuleImports.addDefault)(path, 'styled-components', {

@@ -60,0 +58,0 @@ nameHint: 'styled'

{
"version": "2.0.4",
"version": "2.0.5",
"name": "babel-plugin-styled-components",

@@ -4,0 +4,0 @@ "description": "Improve the debugging experience and add server-side rendering support to styled-components",

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