postcss-minify-params 5.0.5 → 5.1.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,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-minify-params",
3
- "version": "5.0.5",
3
+ "version": "5.1.0",
4
4
  "description": "Minify at-rule params with PostCSS",
5
5
  "keywords": [
6
6
  "postcss",
@@ -11,9 +11,11 @@
11
11
  "params"
12
12
  ],
13
13
  "main": "src/index.js",
14
+ "types": "types/index.d.ts",
14
15
  "files": [
15
16
  "src",
16
- "LICENSE"
17
+ "LICENSE",
18
+ "types"
17
19
  ],
18
20
  "author": "Bogdan Chadkin <trysound@yandex.ru>",
19
21
  "license": "MIT",
@@ -24,7 +26,7 @@
24
26
  "homepage": "https://github.com/cssnano/cssnano",
25
27
  "dependencies": {
26
28
  "browserslist": "^4.16.6",
27
- "cssnano-utils": "^3.0.2",
29
+ "cssnano-utils": "^3.1.0",
28
30
  "postcss-value-parser": "^4.2.0"
29
31
  },
30
32
  "engines": {
package/src/index.js CHANGED
@@ -6,33 +6,58 @@ const { getArguments } = require('cssnano-utils');
6
6
  /**
7
7
  * Return the greatest common divisor
8
8
  * of two numbers.
9
+ *
10
+ * @param {number} a
11
+ * @param {number} b
12
+ * @return {number}
9
13
  */
10
-
11
14
  function gcd(a, b) {
12
15
  return b ? gcd(b, a % b) : a;
13
16
  }
14
17
 
18
+ /**
19
+ * @param {number} a
20
+ * @param {number} b
21
+ * @return {[number, number]}
22
+ */
15
23
  function aspectRatio(a, b) {
16
24
  const divisor = gcd(a, b);
17
25
 
18
26
  return [a / divisor, b / divisor];
19
27
  }
20
28
 
29
+ /**
30
+ * @param {valueParser.Node[]} args
31
+ * @return {string}
32
+ */
21
33
  function split(args) {
22
34
  return args.map((arg) => valueParser.stringify(arg)).join('');
23
35
  }
24
36
 
37
+ /**
38
+ * @param {valueParser.Node} node
39
+ * @return {void}
40
+ */
25
41
  function removeNode(node) {
26
42
  node.value = '';
27
43
  node.type = 'word';
28
44
  }
29
45
 
46
+ /**
47
+ * @param {unknown[]} items
48
+ * @return {string}
49
+ */
30
50
  function sortAndDedupe(items) {
31
51
  const a = [...new Set(items)];
32
52
  a.sort();
33
53
  return a.join();
34
54
  }
35
55
 
56
+ /**
57
+ * @param {boolean} legacy
58
+ * @param {import('postcss').AtRule} rule
59
+ * @return {void}
60
+ */
36
61
  function transform(legacy, rule) {
37
62
  const ruleName = rule.name.toLowerCase();
38
63
 
@@ -95,10 +120,19 @@ function transform(legacy, rule) {
95
120
  }
96
121
  }
97
122
 
123
+ /**
124
+ * @param {string} browser
125
+ * @return {boolean}
126
+ */
98
127
  function hasAllBug(browser) {
99
128
  return ['ie 10', 'ie 11'].includes(browser);
100
129
  }
101
130
 
131
+ /**
132
+ * @type {import('postcss').PluginCreator<browserslist.Options>}
133
+ * @param {browserslist.Options} options
134
+ * @return {import('postcss').Plugin}
135
+ */
102
136
  function pluginCreator(options = {}) {
103
137
  const browsers = browserslist(null, {
104
138
  stats: options.stats,
@@ -0,0 +1,11 @@
1
+ export = pluginCreator;
2
+ /**
3
+ * @type {import('postcss').PluginCreator<browserslist.Options>}
4
+ * @param {browserslist.Options} options
5
+ * @return {import('postcss').Plugin}
6
+ */
7
+ declare function pluginCreator(options?: browserslist.Options): import('postcss').Plugin;
8
+ declare namespace pluginCreator {
9
+ const postcss: true;
10
+ }
11
+ import browserslist = require("browserslist");