diff --git a/.vscode/settings.json b/.vscode/settings.json index 5fb64f4..fd0e5b1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,7 @@ "typescriptreact" ], "editor.codeActionsOnSave": { - "source.fixAll": true + "source.fixAll": "explicit" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/bin/cb.ts b/bin/cb.ts index 8a36f2e..d4fa806 100644 --- a/bin/cb.ts +++ b/bin/cb.ts @@ -3,7 +3,7 @@ import type {Ora} from 'ora'; import shell from 'shelljs'; import {setTimeout} from 'timers'; -import {camelCaseToDash} from '../utils/functions.js'; +import {camelCaseToDash, camelCaseToLowerLetters} from '../utils/functions.js'; export const cbResultExpo = ( template: string, @@ -35,7 +35,7 @@ export const cbResultExpo = ( shell.sed( '-i', 'dooboo', - camelCaseToDash(`${nameOfApp}`), + camelCaseToLowerLetters(`${nameOfApp}`), `./${nameOfApp}/app.config.ts`, ); diff --git a/package-lock.json b/package-lock.json index ebe157d..4ba4d3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dooboo", - "version": "0.1.6", + "version": "0.1.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dooboo", - "version": "0.1.6", + "version": "0.1.7", "license": "MIT", "dependencies": { "boxen": "^7.1.1", diff --git a/utils/functions.ts b/utils/functions.ts index 072f621..bf29f2a 100644 --- a/utils/functions.ts +++ b/utils/functions.ts @@ -84,6 +84,10 @@ export const camelCaseToDash = (str: string): string => { return str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase(); }; +export const camelCaseToLowerLetters = (str: string): string => { + return str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1').toLowerCase(); +}; + export const camelize = (str: string): string => { return str.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, (match, index) => { // or if (/\s+/.test(match)) for white spaces