jest-styled-components
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"name": "jest-styled-components", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Jest utilities for Styled Components", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -18,6 +18,12 @@ const css = require('css') | ||
const filterNodes = classNames => rule => ( | ||
rule.type === 'rule' && classNames.includes(rule.selectors[0].substring(1)) | ||
) | ||
const filterNodes = classNames => (rule) => { | ||
if (rule.type === 'rule') { | ||
const position = rule.selectors[0].indexOf(':') | ||
const indexEnd = position > -1 ? position : rule.selectors[0].length | ||
return classNames.includes(rule.selectors[0].substring(1, indexEnd)) | ||
} | ||
return false | ||
} | ||
const getMediaQueries = (ast, filter) => ( | ||
@@ -24,0 +30,0 @@ ast.stylesheet.rules |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6191
96