Case Convert
Package for converting string cases
Install
npm install @alexvyber/convert-case
pnpm add @alexvyber/convert-case
yarn add @alexvyber/convert-case
Example
import { camelToKebab, kebabToCamel } from "@alexvyber/convert-case"
console.log(camelToKebab("SomeString"))
console.log(camelToKebab("otherString"))
console.log(kebabToCamel("some-string"))
console.log(kebabToCamel("other-string"))
API
Table of Contents
camelToKebab
Converts a string from CamelCase
to kebab-case
.
Parameters
input
T The string in CamelCase
to be converted
Examples
camelToKebab("SomeString")
Returns Kebabtize The string
in kebab-case
kebabToCamel
Converts a string from kebab-case
to CamelCase
.
Parameters
input
T The string in kebab-case
to be converted
Examples
kebabToCamel("some-string")
Returns Camelize The string in CamelCase