Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.5 to 2.0.6

6

lib/utils/detectors.js

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

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

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

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

if (path.node.name.name !== 'css') return;
const program = state.file.path;
let importName = (0, _detectors.importLocalName)('default', state);
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 {

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

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

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

{
"version": "2.0.5",
"version": "2.0.6",
"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