KebabCase

Medium
conditional types
template literal
infer
recursion

Description:

Replace the camelCase or PascalCase string with kebab-case.

FooBarBaz -> foo-bar-baz

For example

type FooBarBaz = KebabCase<"FooBarBaz"> // expect: "foo-bar-baz" type DoNothing = KebabCase<"do-nothing"> // expect "do-nothing"

Code

Loading...