Add Object.freeze on private enums
Improve code readability
This commit is contained in:
@ -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.');
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user