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

Function withEmitClose

src/cursor/abstract_cursor.ts:1005–1011  ·  view source on GitHub ↗
(fn: () => Promise<void>)

Source from the content-addressed store, hash-verified

1003 };
1004
1005 const withEmitClose = async (fn: () => Promise<void>) => {
1006 try {
1007 await fn();
1008 } finally {
1009 this.emitClose();
1010 }
1011 };
1012
1013 const close = async () => {
1014 // if no session has been defined on the cursor, the cursor was never initialized

Callers 1

cleanupFunction · 0.85

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected