camel2hyphen.js 216 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 var camel2hyphen = function (str) { return str .replace(/[A-Z]/g, function (match) { return '-' + match.toLowerCase(); }) .toLowerCase(); }; module.exports = camel2hyphen;