Convert string to target CaseType, like: camelCase, snakeCase, properCase, constantCase
npm i case-modifier
import*asCaseModifierfrom'case-modifier'// type: camelCaseCaseModifier.CASE_CAMELCaseModifier.camelCase('we-will-rock-the-word')// weWillRockTheWord// type: snakeCaseCaseModifier.CASE_SNAKECaseModifier.snakeCase('we-will-rock-the-word')// we_will_rock_the_word// type: kebabCaseCaseModifier.CASE_KEBABCaseModifier.CASE_DASHCaseModifier.kebabCase('WeWillRockTheWord')// we-will-rock-the-word// type: properCaseCaseModifier.CASE_PROPERCaseModifier.CASE_PASCALCaseModifier.properCase('we-will-rock-the-word')// WeWillRockTheWord// type: constantCaseCaseModifier.CASE_CONSTANTCaseModifier.constantCase('WeWillRockTheWord')// WE_WILL_ROCK_THE_WORD// covert(str, caseType)CaseModifier.convert('we-will-rock-the-word')// weWillRockTheWordCaseModifier.convert('we-will-rock-the-word',CaseModifier.CASE_PROPER)// WeWillRockTheWord// if not support, just return source stringCaseModifier.convert('We will rock the word')// We will rock the word