Skip to content

@kaelyx/ts-kit / string / ConvertCaseStyle

Variable: ConvertCaseStyle ​

const ConvertCaseStyle: object

Defined in: string/convert-case/convert-case.types.ts:18

The cases that convertCase can produce, for ConvertCaseOptions.to. Each example converts the words "hello world".

Type Declaration ​

ada ​

readonly ada: "ada" = 'ada'

Hello_World

camel ​

readonly camel: "camel" = 'camel'

helloWorld

cobol ​

readonly cobol: "cobol" = 'cobol'

HELLO-WORLD

constant ​

readonly constant: "constant" = 'constant'

HELLO_WORLD

flat ​

readonly flat: "flat" = 'flat'

helloworld

kebab ​

readonly kebab: "kebab" = 'kebab'

hello-world

lower ​

readonly lower: "lower" = 'lower'

hello world

pascal ​

readonly pascal: "pascal" = 'pascal'

HelloWorld

snake ​

readonly snake: "snake" = 'snake'

hello_world

title ​

readonly title: "title" = 'title'

Hello World

train ​

readonly train: "train" = 'train'

Hello-World

upper ​

readonly upper: "upper" = 'upper'

HELLO WORLD

upperFlat ​

readonly upperFlat: "upperFlat" = 'upperFlat'

HELLOWORLD

Example ​

ts
convertCase('helloWorld', { to: ConvertCaseStyle.snake }) // 'hello_world'
convertCase('helloWorld', { to: 'snake' }) // the same: the plain string also works