mqtt-packet
Advanced tools
Comparing version
{ | ||
"name": "mqtt-packet", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Parse and generate MQTT packets like a breeze", | ||
@@ -5,0 +5,0 @@ "main": "mqtt.js", |
@@ -5,2 +5,3 @@ | ||
, EE = require('events').EventEmitter | ||
, Packet = require('./packet') | ||
, constants = require('./constants') | ||
@@ -33,5 +34,3 @@ | ||
this.packet = { | ||
length: -1 | ||
} | ||
this.packet = new Packet() | ||
@@ -38,0 +37,0 @@ return true |
@@ -14,2 +14,6 @@ | ||
parser.on('packet', function(packet) { | ||
if (packet.cmd !== 'publish') { | ||
delete packet.topic | ||
delete packet.payload | ||
} | ||
t.deepEqual(packet, expected, 'expected packet') | ||
@@ -34,2 +38,6 @@ }) | ||
parser.on('packet', function(packet) { | ||
if (packet.cmd !== 'publish') { | ||
delete packet.topic | ||
delete packet.payload | ||
} | ||
t.deepEqual(packet, expected, 'expected packet') | ||
@@ -36,0 +44,0 @@ }) |
50201
0.84%14
7.69%1562
1.1%