This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

20
node_modules/postcss-normalize-charset/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright 2015 Bogdan Chadkin <trysound@yandex.ru>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

43
node_modules/postcss-normalize-charset/README.md generated vendored Normal file
View File

@@ -0,0 +1,43 @@
# postcss-normalize-charset
Add necessary or remove extra charset with PostCSS
```css
a{
content: "©";
}
```
```css
@charset "utf-8";
a{
content: "©";
}
```
## API
### normalizeCharset([options])
#### options
##### add
Type: `boolean`
Default: `true`
Pass `false` to stop the module from adding a `@charset` declaration if it was
missing from the file (and the file contained non-ascii characters).
## Usage
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
examples for your environment.
## Contributors
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
## License
MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)

35
node_modules/postcss-normalize-charset/package.json generated vendored Normal file
View File

@@ -0,0 +1,35 @@
{
"name": "postcss-normalize-charset",
"version": "5.1.0",
"description": "Add necessary or remove extra charset with PostCSS",
"keywords": [
"postcss",
"css",
"postcss-plugin",
"charset"
],
"author": "Bogdan Chadkin <trysound@yandex.ru>",
"files": [
"src",
"LICENSE",
"types"
],
"license": "MIT",
"repository": "cssnano/cssnano",
"bugs": {
"url": "https://github.com/cssnano/cssnano/issues"
},
"homepage": "https://github.com/cssnano/cssnano",
"main": "src/index.js",
"types": "types/index.d.ts",
"engines": {
"node": "^10 || ^12 || >=14.0"
},
"devDependencies": {
"postcss": "^8.2.15"
},
"peerDependencies": {
"postcss": "^8.2.15"
},
"readme": "# postcss-normalize-charset\n\nAdd necessary or remove extra charset with PostCSS\n\n```css\na{\n content: \"©\";\n}\n```\n\n```css\n@charset \"utf-8\";\na{\n content: \"©\";\n}\n```\n\n## API\n\n### normalizeCharset([options])\n\n#### options\n\n##### add\n\nType: `boolean` \nDefault: `true`\n\nPass `false` to stop the module from adding a `@charset` declaration if it was\nmissing from the file (and the file contained non-ascii characters).\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 © [Bogdan Chadkin](mailto:trysound@yandex.ru)\n"
}

56
node_modules/postcss-normalize-charset/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
'use strict';
const charset = 'charset';
// eslint-disable-next-line no-control-regex
const nonAscii = /[^\x00-\x7F]/;
/**
* @typedef {{add?: boolean}} Options
*/
/**
* @type {import('postcss').PluginCreator<Options>}
* @param {Options} opts
* @return {import('postcss').Plugin}
*/
function pluginCreator(opts = {}) {
return {
postcssPlugin: 'postcss-normalize-' + charset,
OnceExit(css, { AtRule }) {
/** @type {import('postcss').AtRule | undefined} */
let charsetRule;
/** @type {import('postcss').Node | undefined} */
let nonAsciiNode;
css.walk((node) => {
if (node.type === 'atrule' && node.name === charset) {
if (!charsetRule) {
charsetRule = node;
}
node.remove();
} else if (
!nonAsciiNode &&
node.parent === css &&
nonAscii.test(node.toString())
) {
nonAsciiNode = node;
}
});
if (nonAsciiNode) {
if (!charsetRule && opts.add !== false) {
charsetRule = new AtRule({
name: charset,
params: '"utf-8"',
});
}
if (charsetRule) {
charsetRule.source = nonAsciiNode.source;
css.prepend(charsetRule);
}
}
},
};
}
pluginCreator.postcss = true;
module.exports = pluginCreator;

View File

@@ -0,0 +1,17 @@
export = pluginCreator;
/**
* @typedef {{add?: boolean}} Options
*/
/**
* @type {import('postcss').PluginCreator<Options>}
* @param {Options} opts
* @return {import('postcss').Plugin}
*/
declare function pluginCreator(opts?: Options): import('postcss').Plugin;
declare namespace pluginCreator {
export { postcss, Options };
}
type Options = {
add?: boolean;
};
declare var postcss: true;