feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -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) {