refactor: forego namespace

This commit is contained in:
cha0s 2019-04-20 01:47:46 -05:00
parent 0fdff9b33c
commit 7226ca8979
2 changed files with 2 additions and 4 deletions

View File

@ -7,7 +7,6 @@ export class Packet {
static get schema() {
return {
_id: 'uint8',
nsp: 'string',
};
}

View File

@ -52,7 +52,6 @@ class Encoder {
return schema.encode({
_id: eventId,
data: packet.data[1],
nsp: packet.nsp,
});
}
@ -84,12 +83,12 @@ class Decoder extends decorateDecoder(class {}) {
if (!schema) {
throw new Error(`unknown schema with id: ${packetId}`);
}
const {data, nsp} = schema.decode(obj);
const {data} = schema.decode(obj);
const Packet = packetFromId(packetId);
packet = {
type: TYPES.EVENT,
data: [packetId, new Packet(data)],
nsp,
nsp: '/',
};
}
catch (e) {