postcss-merge-rules
Advanced tools
Comparing version
@@ -235,20 +235,20 @@ "use strict"; | ||
intersection = intersection.filter((decl, intersectIndex) => { | ||
const index = indexOfDeclaration(firstDecls, decl); | ||
const nextConflictInFirst = firstDecls.slice(index + 1).find(d => isConflictingProp(d.prop, decl.prop)); | ||
const indexOfDecl = indexOfDeclaration(firstDecls, decl); | ||
const nextConflictInFirst = firstDecls.slice(indexOfDecl + 1).filter(d => isConflictingProp(d.prop, decl.prop)); | ||
if (!nextConflictInFirst) { | ||
if (!nextConflictInFirst.length) { | ||
return true; | ||
} | ||
const nextConflictInIntersection = intersection.slice(intersectIndex + 1).find(d => isConflictingProp(d.prop, decl.prop)); | ||
const nextConflictInIntersection = intersection.slice(intersectIndex + 1).filter(d => isConflictingProp(d.prop, decl.prop)); | ||
if (!nextConflictInIntersection) { | ||
if (!nextConflictInIntersection.length) { | ||
return false; | ||
} | ||
if (declarationIsEqual(nextConflictInFirst, nextConflictInIntersection)) { | ||
return true; | ||
if (nextConflictInFirst.length !== nextConflictInIntersection.length) { | ||
return false; | ||
} | ||
return false; | ||
return nextConflictInFirst.every((d, index) => declarationIsEqual(d, nextConflictInIntersection[index])); | ||
}); // Filter out intersections with previous conflicts in Second | ||
@@ -255,0 +255,0 @@ |
{ | ||
"name": "postcss-merge-rules", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Merge CSS rules with PostCSS.", | ||
@@ -30,3 +30,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"browserslist": "^4.16.0", | ||
"browserslist": "^4.16.6", | ||
"caniuse-api": "^3.0.0", | ||
@@ -49,3 +49,3 @@ "cssnano-utils": "^2.0.1", | ||
}, | ||
"gitHead": "28c247175032fa03f04911cde56ad82d74d211cc" | ||
"gitHead": "9b3c54fd94f3e2bdb503d1e21f171d7fe02f33ca" | ||
} |
19764
-16.31%5
-16.67%Updated