mosya Type Challenges

問題に挑戦!

キャメルケースもしくはパスカルケースの文字列を、ケバブケースに置換する方を実装します。

FooBarBaz -> foo-bar-baz

例えば

type FooBarBaz = KebabCase<"FooBarBaz">;
const foobarbaz: FooBarBaz =
  "foo-bar-baz";

type DoNothing =
  KebabCase<"do-nothing">;
const doNothing: DoNothing =
  "do-nothing";
引用元

この問題はType Challengesの以下の問題を記載したものです。

💡ヒント

Uncapitalizeを使うことで、文字を小文字に変換できます。

🙌 解説はこちら