postcss 8.4.15 → 8.4.17
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.
Potentially problematic release.
This version of postcss might be problematic. Click here for more details.
- package/lib/container.js +11 -11
- package/lib/processor.js +1 -1
- package/package.json +1 -1
package/lib/container.js
CHANGED
@@ -176,16 +176,16 @@ class Container extends Node {
|
|
176
176
|
}
|
177
177
|
|
178
178
|
insertBefore(exist, add) {
|
179
|
-
|
180
|
-
|
179
|
+
let existIndex = this.index(exist)
|
181
180
|
let type = exist === 0 ? 'prepend' : false
|
182
|
-
let nodes = this.normalize(add, this.proxyOf.nodes[
|
183
|
-
|
181
|
+
let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse()
|
182
|
+
existIndex = this.index(exist)
|
183
|
+
for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node)
|
184
184
|
|
185
185
|
let index
|
186
186
|
for (let id in this.indexes) {
|
187
187
|
index = this.indexes[id]
|
188
|
-
if (
|
188
|
+
if (existIndex <= index) {
|
189
189
|
this.indexes[id] = index + nodes.length
|
190
190
|
}
|
191
191
|
}
|
@@ -196,15 +196,15 @@ class Container extends Node {
|
|
196
196
|
}
|
197
197
|
|
198
198
|
insertAfter(exist, add) {
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
for (let node of nodes) this.proxyOf.nodes.splice(
|
199
|
+
let existIndex = this.index(exist)
|
200
|
+
let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse()
|
201
|
+
existIndex = this.index(exist)
|
202
|
+
for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node)
|
203
203
|
|
204
204
|
let index
|
205
205
|
for (let id in this.indexes) {
|
206
206
|
index = this.indexes[id]
|
207
|
-
if (
|
207
|
+
if (existIndex < index) {
|
208
208
|
this.indexes[id] = index + nodes.length
|
209
209
|
}
|
210
210
|
}
|
@@ -408,7 +408,7 @@ Container.registerAtRule = dependant => {
|
|
408
408
|
}
|
409
409
|
|
410
410
|
Container.registerRoot = dependant => {
|
411
|
-
|
411
|
+
Root = dependant
|
412
412
|
}
|
413
413
|
|
414
414
|
module.exports = Container
|
package/lib/processor.js
CHANGED