Skip to content

Commit

Permalink
Merge pull request #6 from devypl/patch-1
Browse files Browse the repository at this point in the history
Update regular expression
  • Loading branch information
gelito authored Jan 2, 2017
2 parents 843a006 + 00cf459 commit adcc93b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/slug-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function makeUniqueCounterSlug(doc, field, values, options, padding, next) {
match = null,
test = new RegExp(options.separator + '(\\d+)$'),
query = {},
search = new RegExp(slug + "(" + options.separator + '(\\d+))?$'),
search = new RegExp('^' + slug + "(" + options.separator + '(\\d+))?$'),
sort = {};

sort[field] = -1;
Expand Down Expand Up @@ -182,4 +182,4 @@ function makeUniqueShortIdSlug(doc, field, values, options, next) {

next(null, slug);
});
}
}

0 comments on commit adcc93b

Please sign in to comment.