Skip to content

Commit 48f340e

Browse files
jinhyukifydarrachequesne
authored andcommitted
[refactor] Fix a small typo and code styling (#88)
1 parent 6e40018 commit 48f340e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var packet = {
5454
encoder.encode(packet, function(encodedPackets) {
5555
var decoder = new parser.Decoder();
5656
decoder.on('decoded', function(decodedPacket) {
57-
// decodedPacket.type == parser.BINARY_EVENTEVENT
57+
// decodedPacket.type == parser.BINARY_EVENT
5858
// Buffer.isBuffer(decodedPacket.data.i) == true
5959
// Buffer.isBuffer(decodedPacket.data.j) == true
6060
// decodedPacket.id == 15

index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ function Decoder() {
229229
Emitter(Decoder.prototype);
230230

231231
/**
232-
* Decodes an ecoded packet string into packet JSON.
232+
* Decodes an encoded packet string into packet JSON.
233233
*
234234
* @param {String} obj - encoded packet
235235
* @return {Object} packet
@@ -250,8 +250,7 @@ Decoder.prototype.add = function(obj) {
250250
} else { // non-binary full packet
251251
this.emit('decoded', packet);
252252
}
253-
}
254-
else if (isBuf(obj) || obj.base64) { // raw binary data
253+
} else if (isBuf(obj) || obj.base64) { // raw binary data
255254
if (!this.reconstructor) {
256255
throw new Error('got binary data when not reconstructing a packet');
257256
} else {
@@ -261,8 +260,7 @@ Decoder.prototype.add = function(obj) {
261260
this.emit('decoded', packet);
262261
}
263262
}
264-
}
265-
else {
263+
} else {
266264
throw new Error('Unknown type: ' + obj);
267265
}
268266
};

0 commit comments

Comments
 (0)