| | |
| | | /** @typedef {import("../../declarations/WebpackOptions").CssGeneratorExportsConvention} CssGeneratorExportsConvention */ |
| | | // Copy from css-loader |
| | | /** |
| | | * Preserve camel case. |
| | | * @param {string} string string |
| | | * @returns {string} result |
| | | */ |
| | |
| | | for (let i = 0; i < result.length; i++) { |
| | | const character = result[i]; |
| | | |
| | | if (isLastCharLower && /[\p{Lu}]/u.test(character)) { |
| | | if (isLastCharLower && /\p{Lu}/u.test(character)) { |
| | | result = `${result.slice(0, i)}-${result.slice(i)}`; |
| | | isLastCharLower = false; |
| | | isLastLastCharUpper = isLastCharUpper; |
| | |
| | | } else if ( |
| | | isLastCharUpper && |
| | | isLastLastCharUpper && |
| | | /[\p{Ll}]/u.test(character) |
| | | /\p{Ll}/u.test(character) |
| | | ) { |
| | | result = `${result.slice(0, i - 1)}-${result.slice(i - 1)}`; |
| | | isLastLastCharUpper = isLastCharUpper; |
| | |
| | | |
| | | // Copy from css-loader |
| | | /** |
| | | * Returns result. |
| | | * @param {string} input input |
| | | * @returns {string} result |
| | | */ |
| | |
| | | }; |
| | | |
| | | /** |
| | | * Returns results. |
| | | * @param {string} input input |
| | | * @param {CssGeneratorExportsConvention | undefined} convention convention |
| | | * @returns {string[]} results |
| | | */ |
| | | module.exports.cssExportConvention = (input, convention) => { |
| | | /** @type {Set<string>} */ |
| | | const set = new Set(); |
| | | if (typeof convention === "function") { |
| | | set.add(convention(input)); |
| | |
| | | |
| | | // Copy from css-loader |
| | | /** |
| | | * Returns result. |
| | | * @param {string} input input |
| | | * @returns {string} result |
| | | */ |