Comparing version 1.0.4 to 1.0.5
@@ -39,3 +39,3 @@ import assert from 'assert'; | ||
assert.ok( | ||
!n.reduce((acc, curr) => acc || curr.type === 'combinator', false), | ||
n.filter((curr) => curr.type === 'combinator').length === 0, | ||
'No combinators allowed in selectors' | ||
@@ -42,0 +42,0 @@ ); |
@@ -8,16 +8,17 @@ import {createRequire} from 'module'; | ||
export const tokenize = (str) => { | ||
return parsel.tokenize(str).reduce( | ||
(acc, curr) => { | ||
if (curr.type === 'comma') { | ||
acc.push([]); | ||
} else { | ||
acc[acc.length - 1].push(curr); | ||
} | ||
let latest = []; | ||
const acc = [latest]; | ||
return acc; | ||
}, | ||
[[]] | ||
); | ||
for (const token of parsel.tokenize(str)) { | ||
if (token.type === 'comma') { | ||
latest = []; | ||
acc.push(latest); | ||
} else { | ||
latest.push(token); | ||
} | ||
} | ||
return acc; | ||
}; | ||
export const specificity = parsel.specificity; |
{ | ||
"name": "dedupe.css", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A CSS from JS tool.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/hyper-views/dedupe.css#readme", |
24969