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.1 to 2.0.2

6

lib/utils/options.js

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

});
exports.useTranspileTemplateLiterals = exports.useTopLevelImportPathMatchers = exports.useSSR = exports.usePureAnnotation = exports.useNamespace = exports.useMinify = exports.useFileName = exports.useDisplayName = exports.useCssProp = void 0;
exports.useTranspileTemplateLiterals = exports.useTopLevelImportPathMatchers = exports.useSSR = exports.usePureAnnotation = exports.useNamespace = exports.useMinify = exports.useMeaninglessFileNames = exports.useFileName = exports.useDisplayName = exports.useCssProp = void 0;

@@ -31,2 +31,6 @@ function getOption({

const useMeaninglessFileNames = state => getOption(state, 'meaninglessFileNames', ['index']);
exports.useMeaninglessFileNames = useMeaninglessFileNames;
const useMinify = state => getOption(state, 'minify');

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

6

lib/visitors/displayNameAndId.js

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

const getBlockName = file => {
const getBlockName = (file, meaninglessFileNames) => {
const name = _path.default.basename(file.opts.filename, _path.default.extname(file.opts.filename));
return name !== 'index' ? name : _path.default.basename(_path.default.dirname(file.opts.filename));
return meaninglessFileNames.includes(name) ? _path.default.basename(_path.default.dirname(file.opts.filename)) : name;
};

@@ -83,3 +83,3 @@

if (file) {
const blockName = getBlockName(file);
const blockName = getBlockName(file, (0, _options.useMeaninglessFileNames)(state));

@@ -86,0 +86,0 @@ if (blockName === componentName) {

@@ -110,3 +110,3 @@ "use strict";

elem.node.attributes = elem.node.attributes.filter(x => t.isJSXAttribute(x) ? x.name.name !== 'css' : false);
elem.node.attributes = elem.node.attributes.filter(x => t.isJSXSpreadAttribute(x) || (t.isJSXAttribute(x) ? x.name.name !== 'css' : false));
elem.node.name = t.jSXIdentifier(id.name);

@@ -113,0 +113,0 @@

{
"version": "2.0.1",
"version": "2.0.2",
"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