deno.land / x / mongoose@6.7.5 / lib / plugins / clearValidating.js

clearValidating.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
/*! * ignore */
module.exports = function clearValidating(schema) { // `this.$__.validating` tracks whether there are multiple validations running // in parallel. We need to clear `this.$__.validating` before post hooks for gh-8597 const unshift = true; schema.s.hooks.post('validate', false, function clearValidatingPostValidate() { if (this.$isSubdocument) { return; }
this.$__.validating = null; }, unshift);
schema.s.hooks.post('validate', false, function clearValidatingPostValidateError(error, res, next) { if (this.$isSubdocument) { next(); return; }
this.$__.validating = null; next(); }, unshift);};
mongoose

Version Info

Tagged at
a year ago