// 驼峰命名转换成短横线命名
const getKebabCase = (str) => {
return str.replace(/[A-Z]/g, (item) => '-' + item.toLowerCase())
}
// 短横线命名转换成驼峰命名
const getCamelCase = (str) => {
return str.replace(/-([a-z])/g, (i, item) => item.toUpperCase())
}
驼峰命名与短横线之间的转换
最新推荐文章于 2025-05-02 14:04:44 发布