Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const process = (rule, pseudo) => {
const params = pseudo.nodes.toString();
const { source, ref } = parser.parse(params);
const { name } = ref;
const file = files[resolve(from, source)];
if(!file.exports[name]) {
throw rule.error(`Invalid external reference: ${name}`, { word : name });
}
// This was a... poor naming choice
const s = selector.selector();
file.exports[name].forEach((value) =>
s.append(selector.className({ value }))
);
const root = selector.root();
root.append(s);
pseudo.replaceWith(root);
};
pseudos.forEach((node) => {
// Replace the :global(...) with its contents
node.replaceWith(processor.selector({
nodes : node.nodes,
source : node.source,
}));
node.walk((child) => {
const key = rename(current, child);
if(!key) {
return;
}
// Don't allow local/global overlap (but globals can overlap each other nbd)
if(key in lookup && !globals[key]) {
throw current.error(reuse, { word : key });
}
function createNewSelectors(selector) {
let newSelectors = [parser.selector()];
selector.walk(node => {
if (!nodeIsInsensitiveAttribute(node)) {
newSelectors.forEach(newSelector => {
newSelector.append(node.clone());
});
return;
}
const sensitiveAttributes = createSensitiveAtributes(node);
const newSelectorsWithSensitiveAttributes = [];
sensitiveAttributes.forEach(newNode => {
newSelectors.forEach(newSelector => {
const newSelectorWithNewNode = newSelector.clone();
newSelectorWithNewNode.append(newNode);