Skip to content

Commit

Permalink
Fixes minor typos in comment, test
Browse files Browse the repository at this point in the history
  • Loading branch information
viveleroi committed Apr 17, 2019
1 parent c5d1c6e commit 9ac4a4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module.exports = function(schema, options) {

// Wrap with case-insensitivity
if (get(path, 'options.uniqueCaseInsensitive') || indexOptions.uniqueCaseInsensitive) {
// Escapse RegExp chars
// Escape RegExp chars
pathValue = pathValue.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
pathValue = new RegExp('^' + pathValue + '$', 'i');
}
Expand Down
2 changes: 1 addition & 1 deletion test/tests/validation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function(mongoose) {
promise.catch(done);
});

it('allow unique records with regex wildcards', function(done) {
it('allows unique records with regex wildcards', function(done) {
var User = mongoose.model('User', helpers.createUserCaseInsensitiveSchema().plugin(uniqueValidator));

// Save the first user
Expand Down

0 comments on commit 9ac4a4c

Please sign in to comment.