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

babel-plugin-cssta-stylename

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-cssta-stylename - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

13

index.js
const utils = require('./utils')
const DEFAULT_CLASS_ATTRIBUTE = 'styleName'
const DEFAULT_ADD_CSS_HASH = true
const DEFAULT_ADD_CSS_HASH = false
const DEFAULT_EXTENSIONS = ['css', 'styl']
const ADD_CSS_HASH_DELAY = 300

@@ -14,2 +15,8 @@ const CSSTA_TEMPLATE = 'styled'

function hasTargetExtension (filename = '', extensions = DEFAULT_EXTENSIONS) {
const match = filename.match(/\.([^/]+)$/)
const extension = match && match[1]
return extension && extensions.includes(extension)
}
module.exports = ({ types: t }) => {

@@ -128,3 +135,3 @@ let lastImport

: DEFAULT_ADD_CSS_HASH
if (addCssHash && /\.css$/.test(state.file.opts.filename)) {
if (addCssHash && hasTargetExtension(state.file.opts.filename, state.opts.extensions)) {
const filename = state.file.opts.filename

@@ -155,3 +162,3 @@ // Delay execution to account for Save All delay in IDEs

lastImport = p
if (/\.css$/.test(p.node.source.value)) stylesImport = p
if (hasTargetExtension(p.node.source.value, state.opts.extensions)) stylesImport = p
}

@@ -158,0 +165,0 @@ })

{
"name": "babel-plugin-cssta-stylename",
"version": "0.1.7",
"version": "0.1.8",
"description": "Transform css imports into cssta template components",

@@ -5,0 +5,0 @@ "keywords": [

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