Add Object.freeze on private enums
Improve code readability
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
module.exports = function GossipSeed(endPoint, hostName) {
|
||||
function GossipSeed(endPoint, hostName) {
|
||||
if (typeof endPoint !== 'object' || !endPoint.host || !endPoint.port) throw new TypeError('endPoint must be have host and port properties.');
|
||||
this.endPoint = endPoint;
|
||||
this.hostName = hostName;
|
||||
Object.freeze(this);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = GossipSeed;
|
Reference in New Issue
Block a user