New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-styled-components-attr

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.0.3 to 0.0.4

4

package.json
{
"name": "babel-plugin-styled-components-attr",
"version": "0.0.3",
"version": "0.0.4",
"description": "CSS attr function in your styled components",

@@ -10,3 +10,3 @@ "main": "src/index.js",

"scripts": {
"test": "standard src test && jest --coverage",
"test": "standard src test && jest --coverage --no-cache",
"test:watch": "jest --watch",

@@ -13,0 +13,0 @@ "release": "npm run test && npm version patch && npm publish && git push --tags"

@@ -77,4 +77,15 @@ module.exports = function (babel) {

returnValue = t.conditionalExpression(
createMemberExpression(),
createMemberExpression(),
t.logicalExpression(
'||',
t.binaryExpression(
'===',
t.identifier('undefined'),
createMemberExpression()
),
t.binaryExpression(
'===',
t.nullLiteral(),
createMemberExpression()
)
),
t.parenthesizedExpression(

@@ -86,3 +97,4 @@ t.binaryExpression(

)
)
),
createMemberExpression()
)

@@ -146,5 +158,5 @@ }

// styled.h1`...`
t.isMemberExpression(parentTag) &&
parentTag.object.name === 'styled' &&
t.isTemplateLiteral(path.node)
t.isMemberExpression(parentTag) &&
parentTag.object.name === 'styled' &&
t.isTemplateLiteral(path.node)
) {

@@ -154,5 +166,5 @@ path.replaceWith(findAndReplaceAttrs(path))

// styled('h1')`...`
t.isCallExpression(parentPath.node.tag) &&
parentPath.node.tag.callee.name === 'styled' &&
t.isTemplateLiteral(path.node)
t.isCallExpression(parentPath.node.tag) &&
parentPath.node.tag.callee.name === 'styled' &&
t.isTemplateLiteral(path.node)
) {

@@ -159,0 +171,0 @@ path.replaceWith(findAndReplaceAttrs(path))

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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