Huge News!Announcing our $40M Series B led by Abstract Ventures.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 4.0.2 to 4.0.3

2

package.json
{
"name": "jest-styled-components",
"version": "4.0.2",
"version": "4.0.3",
"description": "Jest utilities for Styled Components",

@@ -5,0 +5,0 @@ "main": "./src/index.js",

@@ -5,3 +5,3 @@ const css = require('css')

const getClassNames = node => {
const classNames = []
let classNames = new Set()

@@ -12,4 +12,5 @@ if (node.children) {

.reverse()
.forEach(child =>
Array.prototype.unshift.apply(classNames, getClassNames(child))
.forEach(
child =>
(classNames = new Set([...getClassNames(child), ...classNames]))
)

@@ -19,3 +20,3 @@ }

if (node.props && node.props.className) {
Array.prototype.unshift.apply(classNames, node.props.className.split(/\s/))
classNames = new Set([...node.props.className.split(/\s/), ...classNames])
}

@@ -84,3 +85,3 @@

const classNames = getClassNames(val)
const classNames = [...getClassNames(val)]
const style = getStyle(classNames)

@@ -87,0 +88,0 @@ const code = print(val)

@@ -5,11 +5,13 @@ const { printReceived, printExpected } = require('jest-matcher-utils')

const getClassNames = received => {
let className = ''
let className
if (received.$$typeof === Symbol.for('react.test.json')) {
className = received.props.className
} else if (typeof received.find === 'function') {
className = received.find('[className]').first().prop('className')
if (received) {
if (received.$$typeof === Symbol.for('react.test.json')) {
className = received.props.className
} else if (typeof received.find === 'function') {
className = received.find('[className]').first().prop('className')
}
}
return className.split(/\s/)
return className ? className.split(/\s/) : []
}

@@ -16,0 +18,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