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

Function waitForFile

src/gridfs/download.ts:415–428  ·  view source on GitHub ↗
(stream: GridFSBucketReadStream, callback: Callback)

Source from the content-addressed store, hash-verified

413}
414
415function waitForFile(stream: GridFSBucketReadStream, callback: Callback): void {
416 if (stream.s.file) {
417 return callback();
418 }
419
420 if (!stream.s.init) {
421 init(stream);
422 stream.s.init = true;
423 }
424
425 stream.once('file', () => {
426 callback();
427 });
428}
429
430function handleStartOption(
431 stream: GridFSBucketReadStream,

Callers 1

_readMethod · 0.85

Calls 3

onceMethod · 0.80
initFunction · 0.70
callbackFunction · 0.50

Tested by

no test coverage detected