postcss-merge-idents 6.0.1 → 6.0.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-merge-idents",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "description": "Merge keyframe and counter style identifiers.",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "repository": "cssnano/cssnano",
26
26
  "dependencies": {
27
27
  "postcss-value-parser": "^4.2.0",
28
- "cssnano-utils": "^4.0.1"
28
+ "cssnano-utils": "^4.0.2"
29
29
  },
30
30
  "bugs": {
31
31
  "url": "https://github.com/cssnano/cssnano/issues"
@@ -34,7 +34,7 @@
34
34
  "node": "^14 || ^16 || >=18.0"
35
35
  },
36
36
  "devDependencies": {
37
- "postcss": "^8.4.32"
37
+ "postcss": "^8.4.35"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "postcss": "^8.4.31"
package/src/index.js CHANGED
@@ -77,16 +77,19 @@ function mergeAtRules(css) {
77
77
  relevant.cache.push(node);
78
78
  return;
79
79
  } else {
80
- let toString = node.nodes.toString();
80
+ const toString = node.nodes ? node.nodes.toString() : '';
81
81
 
82
82
  relevant.cache.forEach((cached) => {
83
+ const cachedStringContent = cached.nodes
84
+ ? cached.nodes.toString()
85
+ : '';
83
86
  if (
84
87
  cached.name.toLowerCase() === node.name.toLowerCase() &&
85
88
  sameParent(
86
89
  /** @type {any} */ (cached),
87
90
  /** @type {any} */ (node)
88
91
  ) &&
89
- cached.nodes.toString() === toString
92
+ cachedStringContent === toString
90
93
  ) {
91
94
  relevant.removals.push(cached);
92
95
  relevant.replacements[cached.params] = node.params;
package/types/index.d.ts CHANGED
@@ -7,3 +7,4 @@ declare function pluginCreator(): import('postcss').Plugin;
7
7
  declare namespace pluginCreator {
8
8
  let postcss: true;
9
9
  }
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAqIA;;;GAGG;AACH,kCAFY,OAAO,SAAS,EAAE,MAAM,CAUnC"}