Files
lsp/node_modules/mongoose/lib/helpers/topology/isAtlas.js
Arnaud Nelissen 3af7ddab06 Initial commit
2021-11-17 11:25:08 +01:00

12 lines
371 B
JavaScript

'use strict';
module.exports = function isAtlas(topologyDescription) {
if (topologyDescription == null ||
topologyDescription.constructor.name !== 'TopologyDescription') {
return false;
}
const hostnames = Array.from(topologyDescription.servers.keys());
return hostnames.length > 0 &&
hostnames.every(host => host.endsWith('.mongodb.net:27017'));
};