titleize.js 207 B

1234567
  1. var makeString = require('./helper/makeString');
  2. module.exports = function titleize(str) {
  3. return makeString(str).toLowerCase().replace(/(?:^|\s|-)\S/g, function(c) {
  4. return c.toUpperCase();
  5. });
  6. };