hyphenate.js 428 B

1234567891011121314
  1. var toString = require('../lang/toString');
  2. var slugify = require('./slugify');
  3. var unCamelCase = require('./unCamelCase');
  4. /**
  5. * Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case.
  6. */
  7. function hyphenate(str){
  8. str = toString(str);
  9. str = unCamelCase(str);
  10. return slugify(str, "-");
  11. }
  12. module.exports = hyphenate;