Package for converting string cases
npm install @alexvyber/convert-case
pnpm add @alexvyber/convert-case
yarn add @alexvyber/convert-case
import { camelToKebab, kebabToCamel } from "@alexvyber/convert-case"
console.log(camelToKebab("SomeString")) // => some-string
console.log(camelToKebab("otherString")) // => other-string
console.log(kebabToCamel("some-string")) // => SomeString
console.log(kebabToCamel("other-string")) // => OtherString
Converts a string from CamelCase
to kebab-case
.
input
T The string inCamelCase
to be converted
camelToKebab("SomeString") // "some-string"
Returns Kebabtize The string
in kebab-case
Converts a string from kebab-case
to CamelCase
.
input
T The string inkebab-case
to be converted
kebabToCamel("some-string") // "SomeString"
Returns Camelize The string in CamelCase