Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/pmb/node_modules_old/postcss-normalize-charset/src/ drwxrwxrwx | |
| Viewing file: Select action/file-type: '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;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0224 ]-- |