postcss-merge-idents 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.
Files changed (2) hide show
  1. package/package.json +8 -5
  2. package/src/index.js +10 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-merge-idents",
3
- "version": "8.0.2",
3
+ "version": "8.0.4",
4
4
  "description": "Merge keyframe and counter style identifiers.",
5
5
  "exports": {
6
6
  ".": {
@@ -32,11 +32,11 @@
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",
35
- "url": "cssnano/cssnano"
35
+ "url": "git+https://github.com/cssnano/cssnano.git"
36
36
  },
37
37
  "dependencies": {
38
38
  "postcss-value-parser": "^4.2.0",
39
- "cssnano-utils": "^6.0.2"
39
+ "cssnano-utils": "^6.0.4"
40
40
  },
41
41
  "bugs": {
42
42
  "url": "https://github.com/cssnano/cssnano/issues"
@@ -45,9 +45,12 @@
45
45
  "node": "^22.11.0 || ^24.11.0 || >=26.0"
46
46
  },
47
47
  "devDependencies": {
48
- "postcss": "^8.5.25"
48
+ "postcss": "^8.5.26"
49
49
  },
50
50
  "peerDependencies": {
51
- "postcss": "^8.5.25"
51
+ "postcss": "^8.5.26"
52
+ },
53
+ "scripts": {
54
+ "test": "node --test"
52
55
  }
53
56
  }
package/src/index.js CHANGED
@@ -79,22 +79,19 @@ function mergeAtRules(css) {
79
79
  } else {
80
80
  const toString = node.nodes ? node.nodes.toString() : '';
81
81
 
82
- relevant.cache.forEach((cached) => {
82
+ for (const cached of relevant.cache) {
83
83
  const cachedStringContent = cached.nodes
84
84
  ? cached.nodes.toString()
85
85
  : '';
86
86
  if (
87
87
  cached.name.toLowerCase() === node.name.toLowerCase() &&
88
- sameParent(
89
- /** @type {any} */ (cached),
90
- /** @type {any} */ (node)
91
- ) &&
88
+ sameParent(cached, node) &&
92
89
  cachedStringContent === toString
93
90
  ) {
94
91
  relevant.removals.push(cached);
95
92
  relevant.replacements[cached.params] = node.params;
96
93
  }
97
- });
94
+ }
98
95
 
99
96
  relevant.cache.push(node);
100
97
 
@@ -115,10 +112,10 @@ function mergeAtRules(css) {
115
112
  }
116
113
  });
117
114
 
118
- pairs.forEach((pair) => {
115
+ for (const pair of pairs) {
119
116
  const canon = canonical(pair.replacements);
120
117
 
121
- pair.decls.forEach((decl) => {
118
+ for (const decl of pair.decls) {
122
119
  decl.value = valueParser(decl.value)
123
120
  .walk((node) => {
124
121
  if (node.type === 'word') {
@@ -126,9 +123,11 @@ function mergeAtRules(css) {
126
123
  }
127
124
  })
128
125
  .toString();
129
- });
130
- pair.removals.forEach((cached) => cached.remove());
131
- });
126
+ }
127
+ for (const cached of pair.removals) {
128
+ cached.remove();
129
+ }
130
+ }
132
131
  }
133
132
 
134
133
  /**