postcss-normalize-repeat-style 8.0.2 → 8.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -4
- package/src/index.js +11 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-normalize-repeat-style",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.4",
|
|
4
4
|
"description": "Convert two value syntax for repeat-style into one value.",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
|
-
"url": "cssnano/cssnano"
|
|
33
|
+
"url": "git+https://github.com/cssnano/cssnano.git"
|
|
34
34
|
},
|
|
35
35
|
"bugs": {
|
|
36
36
|
"url": "https://github.com/cssnano/cssnano/issues"
|
|
@@ -40,9 +40,12 @@
|
|
|
40
40
|
"node": "^22.11.0 || ^24.11.0 || >=26.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"postcss": "^8.5.
|
|
43
|
+
"postcss": "^8.5.26"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"postcss": "^8.5.
|
|
46
|
+
"postcss": "^8.5.26"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"test": "node --test"
|
|
47
50
|
}
|
|
48
51
|
}
|
package/src/index.js
CHANGED
|
@@ -50,17 +50,17 @@ function transform(value) {
|
|
|
50
50
|
let rangeIndex = 0;
|
|
51
51
|
let shouldContinue = true;
|
|
52
52
|
|
|
53
|
-
parsed.nodes.
|
|
53
|
+
for (const [index, node] of parsed.nodes.entries()) {
|
|
54
54
|
// After comma (`,`) follows next background
|
|
55
55
|
if (isCommaNode(node)) {
|
|
56
56
|
rangeIndex += 1;
|
|
57
57
|
shouldContinue = true;
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
continue;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
if (!shouldContinue) {
|
|
63
|
-
|
|
63
|
+
continue;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// After separator (`/`) follows `background-size` values
|
|
@@ -68,7 +68,7 @@ function transform(value) {
|
|
|
68
68
|
if (node.type === 'div' && node.value === '/') {
|
|
69
69
|
shouldContinue = false;
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
continue;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
if (!ranges[rangeIndex]) {
|
|
@@ -84,7 +84,7 @@ function transform(value) {
|
|
|
84
84
|
ranges[rangeIndex].start = null;
|
|
85
85
|
ranges[rangeIndex].end = null;
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
continue;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
const isRepeatKeyword =
|
|
@@ -94,7 +94,7 @@ function transform(value) {
|
|
|
94
94
|
ranges[rangeIndex].start = index;
|
|
95
95
|
ranges[rangeIndex].end = index;
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
continue;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
if (ranges[rangeIndex].start !== null) {
|
|
@@ -102,11 +102,11 @@ function transform(value) {
|
|
|
102
102
|
ranges[rangeIndex].end = index;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
}
|
|
105
|
+
}
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
for (const range of ranges) {
|
|
108
108
|
if (range.start === null) {
|
|
109
|
-
|
|
109
|
+
continue;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
const nodes = parsed.nodes.slice(
|
|
@@ -115,7 +115,7 @@ function transform(value) {
|
|
|
115
115
|
);
|
|
116
116
|
|
|
117
117
|
if (nodes.length !== 3) {
|
|
118
|
-
|
|
118
|
+
continue;
|
|
119
119
|
}
|
|
120
120
|
const key = nodes
|
|
121
121
|
.filter(evenValues)
|
|
@@ -128,7 +128,7 @@ function transform(value) {
|
|
|
128
128
|
nodes[0].value = match;
|
|
129
129
|
nodes[1].value = nodes[2].value = '';
|
|
130
130
|
}
|
|
131
|
-
}
|
|
131
|
+
}
|
|
132
132
|
|
|
133
133
|
return parsed.toString();
|
|
134
134
|
}
|