postcss-normalize-unicode 6.0.3 → 7.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 +3 -3
- package/src/index.js +21 -9
- package/types/index.d.ts +17 -3
- package/types/index.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-normalize-unicode",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Normalize unicode-range descriptors, and can convert to wildcard ranges.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"url": "https://github.com/cssnano/cssnano/issues"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
|
-
"node": "^
|
|
33
|
+
"node": "^18.12.0 || ^20.9.0 || >=22.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"postcss": "^8.4.
|
|
36
|
+
"postcss": "^8.4.38"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"postcss": "^8.4.31"
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
const { dirname } = require('path');
|
|
2
3
|
const browserslist = require('browserslist');
|
|
3
4
|
const valueParser = require('postcss-value-parser');
|
|
4
5
|
|
|
@@ -89,21 +90,32 @@ function transform(value, isLegacy = false) {
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
/**
|
|
92
|
-
* @
|
|
93
|
+
* @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions
|
|
94
|
+
* @typedef {Pick<browserslist.Options, 'stats' | 'path' | 'env'>} BrowserslistOptions
|
|
95
|
+
* @typedef {AutoprefixerOptions & BrowserslistOptions} Options
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @type {import('postcss').PluginCreator<Options>}
|
|
100
|
+
* @param {Options} opts
|
|
93
101
|
* @return {import('postcss').Plugin}
|
|
94
102
|
*/
|
|
95
|
-
function pluginCreator() {
|
|
103
|
+
function pluginCreator(opts = {}) {
|
|
96
104
|
return {
|
|
97
105
|
postcssPlugin: 'postcss-normalize-unicode',
|
|
98
|
-
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @param {import('postcss').Result & {opts: BrowserslistOptions & {file?: string}}} result
|
|
109
|
+
*/
|
|
99
110
|
prepare(result) {
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
env: resultOpts.env,
|
|
111
|
+
const { stats, env, from, file } = result.opts || {};
|
|
112
|
+
const browsers = browserslist(opts.overrideBrowserslist, {
|
|
113
|
+
stats: opts.stats || stats,
|
|
114
|
+
path: opts.path || dirname(from || file || __filename),
|
|
115
|
+
env: opts.env || env,
|
|
106
116
|
});
|
|
117
|
+
|
|
118
|
+
const cache = new Map();
|
|
107
119
|
const isLegacy = browsers.some(hasLowerCaseUPrefixBug);
|
|
108
120
|
|
|
109
121
|
return {
|
package/types/index.d.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
export = pluginCreator;
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions
|
|
4
|
+
* @typedef {Pick<browserslist.Options, 'stats' | 'path' | 'env'>} BrowserslistOptions
|
|
5
|
+
* @typedef {AutoprefixerOptions & BrowserslistOptions} Options
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @type {import('postcss').PluginCreator<Options>}
|
|
9
|
+
* @param {Options} opts
|
|
4
10
|
* @return {import('postcss').Plugin}
|
|
5
11
|
*/
|
|
6
|
-
declare function pluginCreator(): import('postcss').Plugin;
|
|
12
|
+
declare function pluginCreator(opts?: Options): import('postcss').Plugin;
|
|
7
13
|
declare namespace pluginCreator {
|
|
8
|
-
|
|
14
|
+
export { postcss, AutoprefixerOptions, BrowserslistOptions, Options };
|
|
9
15
|
}
|
|
16
|
+
type Options = AutoprefixerOptions & BrowserslistOptions;
|
|
17
|
+
declare var postcss: true;
|
|
18
|
+
type AutoprefixerOptions = {
|
|
19
|
+
overrideBrowserslist?: string | string[];
|
|
20
|
+
};
|
|
21
|
+
type BrowserslistOptions = Pick<browserslist.Options, 'stats' | 'path' | 'env'>;
|
|
22
|
+
import browserslist = require("browserslist");
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AA2FA;;;;GAIG;AAEH;;;;GAIG;AACH,sCAHW,OAAO,GACN,OAAO,SAAS,EAAE,MAAM,CAwCnC;;;;eA9CY,mBAAmB,GAAG,mBAAmB;;2BAFzC;IAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE;2BAC5C,KAAK,oBAAoB,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC"}
|