camel-to-hyphen.js 217 B

123456789
  1. "use strict";
  2. var replace = String.prototype.replace, re = /([A-Z])/g;
  3. module.exports = function () {
  4. var str = replace.call(this, re, "-$1").toLowerCase();
  5. if (str[0] === "-") str = str.slice(1);
  6. return str;
  7. };