Skip to content

Commit

Permalink
fix matching on titleize
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Jul 20, 2017
1 parent 503ca83 commit dd2245b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ helpers.startsWith = function(prefix, str, options) {

helpers.titleize = function(str) {
if (!util.isString(str)) return '';
var title = str.replace(/[ \-_]+/g, ' ');
var words = title.match(/\w+/g);
var title = str.replace(/[- _]+/g, ' ');
var words = title.split(' ');
var len = words.length;
var res = [];
var i = 0;
Expand Down

0 comments on commit dd2245b

Please sign in to comment.