From 8676d69892e04802e43e6604030257cdb5ac795e Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 10 Dec 2020 19:32:34 -0600 Subject: [PATCH] chore: defaults --- packages/socket/src/packet/packet.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/socket/src/packet/packet.js b/packages/socket/src/packet/packet.js index ec6032d..22e6a95 100644 --- a/packages/socket/src/packet/packet.js +++ b/packages/socket/src/packet/packet.js @@ -14,12 +14,16 @@ export default class Packet { id: 'uint32', nsp: 'string', type: 'uint8', - data: this.data || {}, + data: this.data, }); } return this._builder; } + static get data() { + return {}; + } + static pack(packet) { return this.builder.encode({ id: packet.id || 0,