Skip to content

pantoken-root / packages/core/src / toKebab

関数: toKebab() ​

toKebab(str): string

ベータ

CamelCase またはスペースで区切られた文字列を kebab-case に変換します。

パラメーター ​

str ​

string

戻り値 ​

string

例 ​

ts
import { toKebab } from "@pantoken/core";

toKebab("baseButton");   // → "base-button"
toKebab("Font Family");  // → "font-family"
toKebab("rebrandLight"); // → "rebrand-light"