Add Object.freeze on private enums

Improve code readability
This commit is contained in:
2018-07-09 10:27:12 -07:00
parent c3a63ff8b7
commit 215708014c
55 changed files with 288 additions and 327 deletions

View File

@ -4,7 +4,7 @@ var ClusterDnsEndPointDiscoverer = require('./core/clusterDnsEndPointDiscoverer'
var NoopLogger = require('./common/log/noopLogger');
var ensure = require('./common/utils/ensure');
var defaultConnectionSettings = {
var defaultConnectionSettings = Object.freeze({
log: new NoopLogger(),
verboseLogging: false,
@ -34,7 +34,7 @@ var defaultConnectionSettings = {
maxDiscoverAttempts: 10,
externalGossipPort: 0,
gossipTimeout: 1000
};
});
function merge(a,b) {
@ -151,4 +151,4 @@ module.exports.create = function(settings, endPointOrGossipSeeds, connectionName
if (typeof endPointOrGossipSeeds === 'object') return createFromTcpEndpoint(settings, endPointOrGossipSeeds, connectionName);
if (typeof endPointOrGossipSeeds === 'string') return createFromStringEndpoint(settings, endPointOrGossipSeeds, connectionName);
throw new TypeError('endPointOrGossipSeeds must be an object, a string or an array.');
};
};