allServersUnknown.js 367 B

1234567891011
  1. 'use strict';
  2. module.exports = function allServersUnknown(topologyDescription) {
  3. if (topologyDescription == null ||
  4. topologyDescription.constructor.name !== 'TopologyDescription') {
  5. return false;
  6. }
  7. const servers = Array.from(topologyDescription.servers.values());
  8. return servers.length > 0 && servers.every(server => server.type === 'Unknown');
  9. };