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

jest-styled-components

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-styled-components - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0-0

37

package.json
{
"name": "jest-styled-components",
"version": "2.0.0",
"version": "3.0.0-0",
"description": "Jest utilities for Styled Components",

@@ -18,8 +18,8 @@ "main": "./src/index.js",

"devDependencies": {
"babel-jest": "^19.0.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-jest": "^20.0.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"chalk": "^1.1.3",
"enzyme": "^2.7.1",
"enzyme-to-json": "^1.5.0",
"enzyme": "^2.8.2",
"enzyme-to-json": "^1.5.1",
"eslint": "^3.17.1",

@@ -30,12 +30,12 @@ "eslint-config-airbnb": "^14.1.0",

"eslint-plugin-react": "^6.10.0",
"jest": "^19.0.2",
"jest-diff": "^19.0.0",
"jest-snapshot": "^19.0.2",
"pretty-format": "^19.0.0",
"react": "^15.4.2",
"react-addons-test-utils": "^15.4.2",
"react-dom": "^15.4.2",
"react-test-renderer": "^15.4.2",
"jest": "^20.0.0",
"jest-diff": "^20.0.0",
"jest-snapshot": "^20.0.0",
"pretty-format": "^20.0.0",
"react": "^15.5.4",
"react-addons-test-utils": "^15.5.1",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
"strip-ansi": "^3.0.1",
"styled-components": "^1.4.4"
"styled-components": "rc"
},

@@ -47,10 +47,9 @@ "dependencies": {

"chalk": "^1.1.3",
"jest-diff": "^19.0.0",
"jest-diff": "^20.0.0",
"jest-matcher-utils": "^19.0.0",
"jest-snapshot": "^19.0.2",
"jest-snapshot": "^20.0.0",
"strip-ansi": "^3.0.1",
"styled-components": "^1.4.4"
"styled-components": "^1.4.6"
},
"jest": {
"testEnvironment": "node",
"snapshotSerializers": [

@@ -57,0 +56,0 @@ "enzyme-to-json/serializer"

@@ -12,3 +12,3 @@ const chalk = require('chalk')

(isAddition(line) || isDeletion(line)) &&
(/\.[a-zA-Z]+/.test(line) || /className="[a-zA-Z]+"/.test(line))
(/\.[a-zA-Z]+/.test(line) || /className="(sc-)?[a-zA-Z ]+"/.test(line))
)

@@ -15,0 +15,0 @@

const css = require('css')
const styleSheet = require('styled-components/lib/models/StyleSheet')
const { ServerStyleSheet } = require('styled-components')

@@ -21,3 +22,3 @@ const getClassNames = (node, classNames) => {

const className = rule.selectors[0].split(/:| /)[0]
return classNames.includes(className.substring(1))
return classNames.includes(className.substring(1)) && rule.declarations.length
}

@@ -43,3 +44,5 @@

const getStyles = (classNames) => {
const styles = styleSheet.rules().map(rule => rule.cssText).join('\n')
const styles = ServerStyleSheet
? new ServerStyleSheet().getStyleTags().match(/<style[^>]*>([\s\S]*)<\/style>/)[1]
: styleSheet.rules().map(rule => rule.cssText).join('\n')
const ast = css.parse(styles)

@@ -52,3 +55,3 @@ const filter = filterNodes(classNames)

return css.stringify(ast)
return css.stringify(ast).trim()
}

@@ -55,0 +58,0 @@

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