Skip to content

pantoken-root / packages/core/src / toKebab

函式: toKebab() ​

toKebab(str): string

Beta(測試)

將 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"