MCPcopy Create free account
hub / github.com/Automattic/mongoose / applyQueue

Function applyQueue

lib/document.js:4008–4019  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

4006 */
4007
4008function applyQueue(doc) {
4009 const q = doc.$__schema && doc.$__schema.callQueue;
4010 if (!q.length) {
4011 return;
4012 }
4013
4014 for (const pair of q) {
4015 if (pair[0] !== 'pre' && pair[0] !== 'post' && pair[0] !== 'on') {
4016 doc[pair[0]].apply(doc, pair[1]);
4017 }
4018 }
4019}
4020
4021/*!
4022 * ignore

Callers 1

DocumentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected