WXL
3 天以前 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1
node_modules/webpack/lib/util/conventions.js
@@ -8,6 +8,7 @@
/** @typedef {import("../../declarations/WebpackOptions").CssGeneratorExportsConvention} CssGeneratorExportsConvention */
// Copy from css-loader
/**
 * Preserve camel case.
 * @param {string} string string
 * @returns {string} result
 */
@@ -20,7 +21,7 @@
   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;
@@ -29,7 +30,7 @@
      } 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;
@@ -51,6 +52,7 @@
// Copy from css-loader
/**
 * Returns result.
 * @param {string} input input
 * @returns {string} result
 */
@@ -79,11 +81,13 @@
};
/**
 * 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));
@@ -118,6 +122,7 @@
// Copy from css-loader
/**
 * Returns result.
 * @param {string} input input
 * @returns {string} result
 */