postcss-discard-unused 8.0.3 → 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-discard-unused",
3
- "version": "8.0.3",
3
+ "version": "9.0.0",
4
4
  "description": "Discard unused counter styles, keyframes and fonts.",
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
  "LICENSE-MIT",
@@ -34,7 +30,7 @@
34
30
  },
35
31
  "repository": {
36
32
  "type": "git",
37
- "url": "cssnano/cssnano"
33
+ "url": "git+https://github.com/cssnano/cssnano.git"
38
34
  },
39
35
  "dependencies": {
40
36
  "postcss-selector-parser": "^7.1.5"
@@ -43,7 +39,7 @@
43
39
  "url": "https://github.com/cssnano/cssnano/issues"
44
40
  },
45
41
  "engines": {
46
- "node": "^22.11.0 || ^24.11.0 || >=26.0"
42
+ "node": "^22.22.3 || ^24.15.0 || >=26.0"
47
43
  },
48
44
  "devDependencies": {
49
45
  "postcss": "^8.5.26"
@@ -51,6 +47,7 @@
51
47
  "peerDependencies": {
52
48
  "postcss": "^8.5.26"
53
49
  },
50
+ "type": "module",
54
51
  "scripts": {
55
52
  "test": "node --test"
56
53
  }
package/src/index.js CHANGED
@@ -1,5 +1,4 @@
1
- 'use strict';
2
- const selectorParser = require('postcss-selector-parser');
1
+ import selectorParser from 'postcss-selector-parser';
3
2
 
4
3
  const atrule = 'atrule';
5
4
  const decl = 'decl';
@@ -79,7 +78,7 @@ function hasFont(fontFamily, cache, comma) {
79
78
  * @return {void}
80
79
  */
81
80
  function filterFont({ atRules, values }, comma) {
82
- values = [...new Set(values)];
81
+ const uniqueValues = [...new Set(values)];
83
82
  for (const r of atRules) {
84
83
  if (r.nodes !== undefined) {
85
84
  /** @type {import('postcss').Declaration[]} */
@@ -95,7 +94,7 @@ function filterFont({ atRules, values }, comma) {
95
94
  }
96
95
 
97
96
  for (const family of families) {
98
- if (!hasFont(family.value.toLowerCase(), values, comma)) {
97
+ if (!hasFont(family.value.toLowerCase(), uniqueValues, comma)) {
99
98
  r.remove();
100
99
  }
101
100
  }
@@ -314,8 +313,8 @@ function pluginCreator(opts) {
314
313
  },
315
314
  };
316
315
  }
317
-
316
+ /** @type {true} */
318
317
  pluginCreator.postcss = true;
319
- module.exports = /** @type {import('postcss').PluginCreator<Options>}*/ (
320
- pluginCreator
321
- );
318
+ const moduleExports = pluginCreator;
319
+
320
+ export { moduleExports as default, moduleExports as 'module.exports' };
package/types/index.d.ts CHANGED
@@ -1,9 +1,17 @@
1
- declare const _exports: import("postcss").PluginCreator<Options>;
2
- export = _exports;
3
1
  export type Options = {
4
2
  fontFace?: boolean;
5
3
  counterStyle?: boolean;
6
4
  keyframes?: boolean;
7
5
  namespace?: boolean;
8
6
  };
7
+ /**
8
+ * @param {Options} opts
9
+ * @return {import('postcss').Plugin}
10
+ */
11
+ declare function pluginCreator(opts: Options): import('postcss').Plugin;
12
+ declare namespace pluginCreator {
13
+ var postcss: true;
14
+ }
15
+ declare const moduleExports: typeof pluginCreator;
16
+ export { moduleExports as default, moduleExports as 'module.exports' };
9
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;AAuHG,YAAkG,OAAO,GAA/F;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAC,CAAS"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAsHG,YAAkG,OAAO,GAA/F;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAC,CAAS;AAgI5G;;;GAGG;AACH,iBAAS,aAAa,CAAC,IAAI,EAHhB,OAGgB,GAFf,OAAO,SAAS,EAAE,MAAM,CAkEnC;kBAhEQ,aAAa;iBAiEX,IAAI;;AAEf,QAAA,MAAM,aAAa,sBAAgB,CAAC;AAEpC,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,CAAC"}