Skip to content

Commit

Permalink
fix con resolve de las promesa eliminada
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Carlos Muñoz committed Sep 5, 2023
1 parent db8d34a commit eed32e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
es2022: true
},
plugins: ["prettier"],
extends: ["plugin:prettier/recommended"],
extends: ["eslint:recommended"],
rules: {
"no-console": 0,
"max-len": [
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = function (schema, options) {
//no escapar si es un arreglo
if (!Array.isArray(pathValue)) {
// Escape RegExp chars
pathValue = pathValue.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
pathValue = pathValue.replace(/[-[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
pathValue = new RegExp("^" + pathValue + "$", "i");
}
}
Expand All @@ -92,7 +92,7 @@ module.exports = function (schema, options) {
conditions._id = {$ne: this._id};
} else {
// if is not new and is not query and the pathName is _id then is the same document no need to check anything
return resolve(true);
return true;
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongoose-unique-validator",
"version": "2.1.6",
"version": "2.1.7",
"description": "mongoose-unique-validator is a plugin which adds pre-save validation for unique fields within a Mongoose schema.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit eed32e2

Please sign in to comment.