feat: refactoring project
This commit is contained in:
19
node_modules/webpack/lib/util/conventions.js
generated
vendored
19
node_modules/webpack/lib/util/conventions.js
generated
vendored
@@ -12,7 +12,7 @@
|
||||
* @param {CssGeneratorExportsConvention | undefined} convention convention
|
||||
* @returns {string[]} results
|
||||
*/
|
||||
exports.cssExportConvention = (input, convention) => {
|
||||
module.exports.cssExportConvention = (input, convention) => {
|
||||
const set = new Set();
|
||||
if (typeof convention === "function") {
|
||||
set.add(convention(input));
|
||||
@@ -20,20 +20,20 @@ exports.cssExportConvention = (input, convention) => {
|
||||
switch (convention) {
|
||||
case "camel-case": {
|
||||
set.add(input);
|
||||
set.add(exports.camelCase(input));
|
||||
set.add(module.exports.camelCase(input));
|
||||
break;
|
||||
}
|
||||
case "camel-case-only": {
|
||||
set.add(exports.camelCase(input));
|
||||
set.add(module.exports.camelCase(input));
|
||||
break;
|
||||
}
|
||||
case "dashes": {
|
||||
set.add(input);
|
||||
set.add(exports.dashesCamelCase(input));
|
||||
set.add(module.exports.dashesCamelCase(input));
|
||||
break;
|
||||
}
|
||||
case "dashes-only": {
|
||||
set.add(exports.dashesCamelCase(input));
|
||||
set.add(module.exports.dashesCamelCase(input));
|
||||
break;
|
||||
}
|
||||
case "as-is": {
|
||||
@@ -50,18 +50,15 @@ exports.cssExportConvention = (input, convention) => {
|
||||
* @param {string} input input
|
||||
* @returns {string} result
|
||||
*/
|
||||
exports.dashesCamelCase = input => {
|
||||
return input.replace(/-+(\w)/g, (match, firstLetter) =>
|
||||
firstLetter.toUpperCase()
|
||||
);
|
||||
};
|
||||
module.exports.dashesCamelCase = input =>
|
||||
input.replace(/-+(\w)/g, (match, firstLetter) => firstLetter.toUpperCase());
|
||||
|
||||
// Copy from css-loader
|
||||
/**
|
||||
* @param {string} input input
|
||||
* @returns {string} result
|
||||
*/
|
||||
exports.camelCase = input => {
|
||||
module.exports.camelCase = input => {
|
||||
let result = input.trim();
|
||||
|
||||
if (result.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user