Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function check(selector, node) {
const declarations = node.nodes;
const params = node.parent.params;
const parentNodes = node.parent.nodes;
if (!declarations) return true;
if (!isStandardSyntaxSelector(selector)) {
return true;
}
if (isCustomSelector(selector)) {
return true;
}
let currentSelector = null;
const declarationsIsMatched = declarations.some(declaration => {
const noMatchedParams = !params || params.indexOf('prefers-reduced-motion') === -1;
const index = targetProperties.indexOf(declaration.prop);
currentSelector = targetProperties[index];
if (targetProperties.indexOf(declaration.prop) >= 0 && declaration.value === 'none') {
return false;
}
return index >= 0 && noMatchedParams;
});