Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const addMod = node => {
let {attribute, value = ''} = node;
let prev = node.prev();
while (
prev &&
!(parser.isTag(prev) || parser.isIdentifier(prev)) &&
!parser.isCombinator(prev)
) {
const curr = prev;
prev = curr.prev();
if (parser.isPseudo(curr)) {
continue;
} else if (!parser.isAttribute(curr)) {
continue;
}
}
const tag = (prev && prev.value) || '__common__';
value = value.replace(/^['"]/, '').replace(/['"]$/, '');
let name;
let type;
const elem = addElem(tag);
if (node.namespace) {
const isPseudo = node => {
return parser.isSelector(node) && parser.isPseudo(node.parent);
};