lib/topologies/shared.js
function(topology) {
  const maxWireVersion = topology.lastIsMaster().maxWireVersion;
  if (maxWireVersion < RETRYABLE_WIRE_VERSION) {
    return false;
  }

  if (!topology.logicalSessionTimeoutMinutes) {
    return false;
  }

  if (topologyType(topology) === TopologyType.Single) {
    return false;
  }

  return true;
}
function(topology) {
  const maxWireVersion = topology.lastIsMaster().maxWireVersion;
  if (maxWireVersion < RETRYABLE_WIRE_VERSION) {
    return false;
  }

  if (!topology.logicalSessionTimeoutMinutes) {
    return false;
  }

  if (topologyType(topology) === TopologyType.Single) {
    return false;
  }

  return true;
}
function ( topology ) { const maxWireVersion = topology . lastIsMaster ( ) . maxWireVersion ; if ( maxWireVersion < RETRYABLE_WIRE_VERSION ) { return false ; } if ( ! topology . logicalSessionTimeoutMinutes ) { return false ; } if ( topologyType ( topology ) === TopologyType . Single ) { return false ; } return true ; }
Determines whether the provided topology supports retryable writes

@param {Mongos|Replset} topology
Determines whether the provided topology supports retryable writes