Skip to content

pantoken / 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"