node_modules/.cache/esm/37ab45f87abedcda.js
// Collect all events in order from SDAM
Collect all events in order from SDAM
Collect all events in order from SDAM
function collectEvents(mongoClient, topology) {
  const MongoClient = require('../mongo_client');
  const collectedEvents = [];
  if (mongoClient instanceof MongoClient) {
    monitoringEvents.forEach(event => {
      topology.on(event, (object1, object2) => {
        if (event === 'open') {
          collectedEvents.push({ event: event, object1: mongoClient });
        } else {
          collectedEvents.push({ event: event, object1: object1, object2: object2 });
        }
      });
    });
  }
  return collectedEvents;
}
function collectEvents ( mongoClient , topology ) { const MongoClient = require ( '../mongo_client' ) ; const collectedEvents = [ ] ; if ( mongoClient instanceof MongoClient ) { monitoringEvents . forEach ( event => { topology . on ( event , ( object1 , object2 ) => { if ( event === 'open' ) { collectedEvents . push ( { event : event , object1 : mongoClient } ) ; } else { collectedEvents . push ( { event : event , object1 : object1 , object2 : object2 } ) ; } } ) ; } ) ; } return collectedEvents ; }
Collect all events in order from SDAM
Collect all events in order from SDAM