Skip to content

Commit 0342e49

Browse files
committed
Fix sorting issue in Node.js 11
1 parent 49b324b commit 0342e49

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/sorting.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ function sortDeclarations(a, b) {
1414
if (!postcss.vendor.prefix(a.name).length && postcss.vendor.prefix(b.name).length) {
1515
return 1;
1616
}
17+
18+
if (postcss.vendor.prefix(a.name).length && !postcss.vendor.prefix(b.name).length) {
19+
return -1;
20+
}
1721
}
1822

1923
if (!_.isUndefined(a.orderData) && !_.isUndefined(b.orderData)) {
@@ -68,6 +72,10 @@ function sortDeclarationsAlphabetically(a, b) {
6872
if (!postcss.vendor.prefix(a.name).length && postcss.vendor.prefix(b.name).length) {
6973
return 1;
7074
}
75+
76+
if (postcss.vendor.prefix(a.name).length && !postcss.vendor.prefix(b.name).length) {
77+
return -1;
78+
}
7179
}
7280

7381
return a.initialIndex - b.initialIndex;

0 commit comments

Comments
 (0)