allServersUnknown.js 396 B

123456789101112
  1. 'use strict';
  2. const getConstructorName = require('../getConstructorName');
  3. module.exports = function allServersUnknown(topologyDescription) {
  4. if (getConstructorName(topologyDescription) !== '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. };