postcss-normalize-charset 5.0.3 → 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 +4 -2
- package/src/index.js +10 -0
- package/types/index.d.ts +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-normalize-charset",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Add necessary or remove extra charset with PostCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"postcss",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"author": "Bogdan Chadkin <trysound@yandex.ru>",
|
|
12
12
|
"files": [
|
|
13
13
|
"src",
|
|
14
|
-
"LICENSE"
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"types"
|
|
15
16
|
],
|
|
16
17
|
"license": "MIT",
|
|
17
18
|
"repository": "cssnano/cssnano",
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
},
|
|
21
22
|
"homepage": "https://github.com/cssnano/cssnano",
|
|
22
23
|
"main": "src/index.js",
|
|
24
|
+
"types": "types/index.d.ts",
|
|
23
25
|
"engines": {
|
|
24
26
|
"node": "^10 || ^12 || >=14.0"
|
|
25
27
|
},
|
package/src/index.js
CHANGED
|
@@ -3,12 +3,22 @@ const charset = 'charset';
|
|
|
3
3
|
// eslint-disable-next-line no-control-regex
|
|
4
4
|
const nonAscii = /[^\x00-\x7F]/;
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {{add?: boolean}} Options
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @type {import('postcss').PluginCreator<Options>}
|
|
11
|
+
* @param {Options} opts
|
|
12
|
+
* @return {import('postcss').Plugin}
|
|
13
|
+
*/
|
|
6
14
|
function pluginCreator(opts = {}) {
|
|
7
15
|
return {
|
|
8
16
|
postcssPlugin: 'postcss-normalize-' + charset,
|
|
9
17
|
|
|
10
18
|
OnceExit(css, { AtRule }) {
|
|
19
|
+
/** @type {import('postcss').AtRule | undefined} */
|
|
11
20
|
let charsetRule;
|
|
21
|
+
/** @type {import('postcss').Node | undefined} */
|
|
12
22
|
let nonAsciiNode;
|
|
13
23
|
|
|
14
24
|
css.walk((node) => {
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export = pluginCreator;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {{add?: boolean}} Options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @type {import('postcss').PluginCreator<Options>}
|
|
7
|
+
* @param {Options} opts
|
|
8
|
+
* @return {import('postcss').Plugin}
|
|
9
|
+
*/
|
|
10
|
+
declare function pluginCreator(opts?: Options): import('postcss').Plugin;
|
|
11
|
+
declare namespace pluginCreator {
|
|
12
|
+
export { postcss, Options };
|
|
13
|
+
}
|
|
14
|
+
type Options = {
|
|
15
|
+
add?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare var postcss: true;
|