MCPcopy
hub / github.com/mongodb/node-mongodb-native / cleanup

Function cleanup

test/integration/shared.js:119–123  ·  view source on GitHub ↗
(testErr)

Source from the content-addressed store, hash-verified

117function withCursor(cursor, body, done) {
118 let clean = false;
119 function cleanup(testErr) {
120 if (clean) return;
121 clean = true;
122 return cursor.close(closeErr => done(testErr || closeErr));
123 }
124 try {
125 body(cursor, cleanup);
126 } catch (err) {

Callers 1

withCursorFunction · 0.70

Calls 2

doneFunction · 0.50
closeMethod · 0.45

Tested by

no test coverage detected