postcss-merge-idents 8.0.4 → 9.0.0

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,16 +1,12 @@
1
1
  {
2
2
  "name": "postcss-merge-idents",
3
- "version": "8.0.4",
3
+ "version": "9.0.0",
4
4
  "description": "Merge keyframe and counter style identifiers.",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./types/index.d.ts",
8
8
  "default": "./src/index.js"
9
- },
10
- "./src": "./src/index.js",
11
- "./src/index": "./src/index.js",
12
- "./src/index.js": "./src/index.js",
13
- "./package.json": "./package.json"
9
+ }
14
10
  },
15
11
  "files": [
16
12
  "src",
@@ -35,14 +31,14 @@
35
31
  "url": "git+https://github.com/cssnano/cssnano.git"
36
32
  },
37
33
  "dependencies": {
38
- "postcss-value-parser": "^4.2.0",
39
- "cssnano-utils": "^6.0.4"
34
+ "cssnano-utils": "^7.0.0",
35
+ "postcss-value-parser": "^4.2.0"
40
36
  },
41
37
  "bugs": {
42
38
  "url": "https://github.com/cssnano/cssnano/issues"
43
39
  },
44
40
  "engines": {
45
- "node": "^22.11.0 || ^24.11.0 || >=26.0"
41
+ "node": "^22.22.3 || ^24.15.0 || >=26.0"
46
42
  },
47
43
  "devDependencies": {
48
44
  "postcss": "^8.5.26"
@@ -50,6 +46,7 @@
50
46
  "peerDependencies": {
51
47
  "postcss": "^8.5.26"
52
48
  },
49
+ "type": "module",
53
50
  "scripts": {
54
51
  "test": "node --test"
55
52
  }
package/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
- 'use strict';
2
- const valueParser = require('postcss-value-parser');
3
- const { sameParent } = require('cssnano-utils');
1
+ import valueParser from 'postcss-value-parser';
2
+ import cssnanoUtils from 'cssnano-utils';
4
3
 
4
+ const { sameParent } = cssnanoUtils;
5
5
  const keyframesRegex = /keyframes/i;
6
6
  const animationRegex = /animation/i;
7
7
  const counterStyleRegex = /counter-style/i;
@@ -59,15 +59,15 @@ function mergeAtRules(css) {
59
59
  ];
60
60
 
61
61
  /**
62
- * @type {{atrule: RegExp, decl: RegExp, replacements: Record<string, string>, removals: import('postcss').AtRule[], cache: import('postcss').AtRule[], decls: import('postcss').Declaration[]}}
62
+ * @type {{atrule: RegExp, decl: RegExp, replacements: Record<string, string>, removals: import('postcss').AtRule[], cache: import('postcss').AtRule[], decls: import('postcss').Declaration[]} | undefined}
63
63
  */
64
64
  let relevant;
65
65
 
66
66
  css.walk((node) => {
67
67
  if (node.type === 'atrule') {
68
- relevant = pairs.filter((pair) =>
68
+ relevant = pairs.find((pair) =>
69
69
  pair.atrule.test(node.name.toLowerCase())
70
- )[0];
70
+ );
71
71
 
72
72
  if (!relevant) {
73
73
  return;
@@ -100,9 +100,7 @@ function mergeAtRules(css) {
100
100
  }
101
101
 
102
102
  if (node.type === 'decl') {
103
- relevant = pairs.filter((pair) =>
104
- pair.decl.test(node.prop.toLowerCase())
105
- )[0];
103
+ relevant = pairs.find((pair) => pair.decl.test(node.prop.toLowerCase()));
106
104
 
107
105
  if (!relevant) {
108
106
  return;
@@ -144,8 +142,8 @@ function pluginCreator() {
144
142
  },
145
143
  };
146
144
  }
147
-
145
+ /** @type {true} */
148
146
  pluginCreator.postcss = true;
149
- module.exports = /** @type {import('postcss').PluginCreator<void>} */ (
150
- pluginCreator
151
- );
147
+ const moduleExports = pluginCreator;
148
+
149
+ export { moduleExports as default, moduleExports as 'module.exports' };
package/types/index.d.ts CHANGED
@@ -1,3 +1,10 @@
1
- declare const _exports: import("postcss").PluginCreator<void>;
2
- export = _exports;
1
+ /**
2
+ * @return {import('postcss').Plugin}
3
+ */
4
+ declare function pluginCreator(): import('postcss').Plugin;
5
+ declare namespace pluginCreator {
6
+ var postcss: true;
7
+ }
8
+ declare const moduleExports: typeof pluginCreator;
9
+ export { moduleExports as default, moduleExports as 'module.exports' };
3
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAkIA;;GAEG;AACH,iBAAS,aAAa,IAFV,OAAO,SAAS,EAAE,MAAM,CAYnC;kBAVQ,aAAa;iBAWX,IAAI;;AAEf,QAAA,MAAM,aAAa,sBAAgB,CAAC;AAEpC,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,CAAC"}