Cleanup
This commit is contained in:
5
node_modules/mongoose/lib/helpers/model/applyHooks.js
generated
vendored
5
node_modules/mongoose/lib/helpers/model/applyHooks.js
generated
vendored
@@ -75,9 +75,12 @@ function applyHooks(model, schema, options) {
|
||||
if (hook.name === 'updateOne' || hook.name === 'deleteOne') {
|
||||
return !!hook['document'];
|
||||
}
|
||||
if (hook.name === 'remove') {
|
||||
if (hook.name === 'remove' || hook.name === 'init') {
|
||||
return hook['document'] == null || !!hook['document'];
|
||||
}
|
||||
if (hook.query != null || hook.document != null) {
|
||||
return hook.document !== false;
|
||||
}
|
||||
return true;
|
||||
}).
|
||||
filter(hook => {
|
||||
|
||||
Reference in New Issue
Block a user