c01nd01r
10/21/2017 - 1:49 PM

Hyphenate a camelCase string. (Vue.js)

Hyphenate a camelCase string. (Vue.js)

/**
 * Hyphenate a camelCase string.
 */
  var hyphenateRE = /\B([A-Z])/g;
  var hyphenate = function(str) {
      return str.replace(hyphenateRE, '-$1').toLowerCase()
  };