From 9ac4a4c5678918f893fabe9a521d989b2ff56d90 Mon Sep 17 00:00:00 2001 From: Mike Botsko Date: Wed, 17 Apr 2019 11:51:47 -0700 Subject: [PATCH] Fixes minor typos in comment, test --- index.js | 2 +- test/tests/validation.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d8d93cf..5f0a6c5 100644 --- a/index.js +++ b/index.js @@ -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'); } diff --git a/test/tests/validation.spec.js b/test/tests/validation.spec.js index 0f661d7..46aecb6 100644 --- a/test/tests/validation.spec.js +++ b/test/tests/validation.spec.js @@ -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