pure-engine
Advanced tools
Comparing version 0.9.18 to 0.9.19
{ | ||
"name": "pure-engine", | ||
"version": "0.9.18", | ||
"version": "0.9.19", | ||
"description": "Compile HTML templates into JS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,2 +5,3 @@ const { parse, walk, generate } = require('css-tree') | ||
const { unique } = require('pure-utilities/array') | ||
const { extractValues } = require('../string') | ||
@@ -32,3 +33,3 @@ function addScopeToCssSelectors (node, scopes) { | ||
const attribute = attributes.find(attribute => attribute.key === 'class') | ||
const values = attribute.value.split(/\s+/g) | ||
const values = extractValues(attribute) | ||
const classes = values.reduce((strings, string) => { | ||
@@ -35,0 +36,0 @@ strings.push(string) |
@@ -48,2 +48,15 @@ const { string: { singlespace } } = require('pure-utilities') | ||
function extractValues (attribute) { | ||
return extract(attribute.value) | ||
.reduce((values, { value }) => { | ||
if (isCurlyTag(value)) { | ||
values.push(value.trim()) | ||
} else { | ||
const parts = value.split(/\s+/g) | ||
parts.forEach(part => values.push(part)) | ||
} | ||
return values | ||
}, []) | ||
} | ||
function getName (name) { | ||
@@ -56,2 +69,2 @@ if (name.endsWith('.bind')) { | ||
module.exports = {extract, getName, isCurlyTag, getExpressionFromCurlyTag} | ||
module.exports = {extract, extractValues, getName, isCurlyTag, getExpressionFromCurlyTag} |
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
97892
2421