src/index.js
function camelToKebab(str) {
  // Matches all places where a two upper case chars followed by a lower case char are and split them with an hyphen
  return str.replace(/([a-zA-Z])([A-Z][a-z])/g, (match, before, after) =>
    `${before.toLowerCase()}-${after.toLowerCase()}`
  ).toLowerCase();
}
function camelToKebab(str) {
  // Matches all places where a two upper case chars followed by a lower case char are and split them with an hyphen
  return str.replace(/([a-zA-Z])([A-Z][a-z])/g, (match, before, after) =>
    `${before.toLowerCase()}-${after.toLowerCase()}`
  ).toLowerCase();
}
function camelToKebab ( str ) { // Matches all places where a two upper case chars followed by a lower case char are and split them with an hyphen return str . replace ( / ([a-zA-Z])([A-Z][a-z]) / g , ( match , before , after ) => ` ${ before . toLowerCase ( ) } ${ after . toLowerCase ( ) } ` ) . toLowerCase ( ) ; }
Converts camel case to kebab case
@param {string} str
@returns {string}
Converts camel case to kebab case