You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
275 B
10 lines
275 B
/**
|
|
* Convert camelCase to kebab-case
|
|
* @param {string} str input string in camelCase
|
|
* @returns {string} output string in kebab-case
|
|
*/
|
|
function toKebabCase(str) {
|
|
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
}
|
|
|
|
module.exports = { toKebabCase };
|
|
|