Changes
This commit is contained in:
4
node_modules/mongoose/lib/schema/string.js
generated
vendored
4
node_modules/mongoose/lib/schema/string.js
generated
vendored
@@ -516,6 +516,10 @@ SchemaString.prototype.match = function match(regExp, message) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// In case RegExp happens to have `/g` flag set, we need to reset the
|
||||
// `lastIndex`, otherwise `match` will intermittently fail.
|
||||
regExp.lastIndex = 0;
|
||||
|
||||
const ret = ((v != null && v !== '')
|
||||
? regExp.test(v)
|
||||
: true);
|
||||
|
||||
Reference in New Issue
Block a user