postcss-normalize-unicode 5.0.4 → 5.1.1

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,11 +1,13 @@
1
1
  {
2
2
  "name": "postcss-normalize-unicode",
3
- "version": "5.0.4",
3
+ "version": "5.1.1",
4
4
  "description": "Normalize unicode-range descriptors, and can convert to wildcard ranges.",
5
5
  "main": "src/index.js",
6
+ "types": "types/index.d.ts",
6
7
  "files": [
7
8
  "src",
8
- "LICENSE-MIT"
9
+ "LICENSE-MIT",
10
+ "types"
9
11
  ],
10
12
  "keywords": [
11
13
  "css",
@@ -21,7 +23,7 @@
21
23
  },
22
24
  "repository": "cssnano/cssnano",
23
25
  "dependencies": {
24
- "browserslist": "^4.16.6",
26
+ "browserslist": "^4.21.4",
25
27
  "postcss-value-parser": "^4.2.0"
26
28
  },
27
29
  "bugs": {
@@ -35,6 +37,5 @@
35
37
  },
36
38
  "peerDependencies": {
37
39
  "postcss": "^8.2.15"
38
- },
39
- "readme": "# [postcss][postcss]-normalize-unicode\n\n> Normalize unicode with PostCSS.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-normalize-unicode) do:\n\n```\nnpm install postcss-normalize-unicode --save\n```\n\n## Example\n\n### Input\n\n```css\n@font-face{\n font-family: test;\n unicode-range: u+2b00-2bff\n}\n```\n\n### Output\n\n```css\n@font-face{\n font-family: test;\n unicode-range: u+2b??\n}\n``` \n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n"
40
+ }
40
41
  }
package/src/index.js CHANGED
@@ -4,6 +4,10 @@ const valueParser = require('postcss-value-parser');
4
4
 
5
5
  const regexLowerCaseUPrefix = /^u(?=\+)/;
6
6
 
7
+ /**
8
+ * @param {string} range
9
+ * @return {string}
10
+ */
7
11
  function unicode(range) {
8
12
  const values = range.slice(2).split('-');
9
13
 
@@ -52,16 +56,22 @@ function mergeRangeBounds(left, right) {
52
56
  }
53
57
  }
54
58
 
55
- /*
59
+ /**
56
60
  * IE and Edge before 16 version ignore the unicode-range if the 'U' is lowercase
57
61
  *
58
62
  * https://caniuse.com/#search=unicode-range
63
+ *
64
+ * @param {string} browser
65
+ * @return {boolean}
59
66
  */
60
-
61
67
  function hasLowerCaseUPrefixBug(browser) {
62
68
  return browserslist('ie <=11, edge <= 15').includes(browser);
63
69
  }
64
70
 
71
+ /**
72
+ * @param {string} value
73
+ * @return {string}
74
+ */
65
75
  function transform(value, isLegacy = false) {
66
76
  return valueParser(value)
67
77
  .walk((child) => {
@@ -78,9 +88,14 @@ function transform(value, isLegacy = false) {
78
88
  .toString();
79
89
  }
80
90
 
91
+ /**
92
+ * @type {import('postcss').PluginCreator<void>}
93
+ * @return {import('postcss').Plugin}
94
+ */
81
95
  function pluginCreator() {
82
96
  return {
83
97
  postcssPlugin: 'postcss-normalize-unicode',
98
+ /** @param {import('postcss').Result & {opts: browserslist.Options}} result*/
84
99
  prepare(result) {
85
100
  const cache = new Map();
86
101
  const resultOpts = result.opts || {};
@@ -0,0 +1,9 @@
1
+ export = pluginCreator;
2
+ /**
3
+ * @type {import('postcss').PluginCreator<void>}
4
+ * @return {import('postcss').Plugin}
5
+ */
6
+ declare function pluginCreator(): import('postcss').Plugin;
7
+ declare namespace pluginCreator {
8
+ const postcss: true;
9
+ }