File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ export class Decoder extends Emitter {
245
245
return typeof payload === "string" || typeof payload === "object" ;
246
246
case PacketType . EVENT :
247
247
case PacketType . BINARY_EVENT :
248
- return Array . isArray ( payload ) && typeof payload [ 0 ] === "string" ;
248
+ return Array . isArray ( payload ) && payload . length > 0 ;
249
249
case PacketType . ACK :
250
250
case PacketType . BINARY_ACK :
251
251
return Array . isArray ( payload ) ;
Original file line number Diff line number Diff line change @@ -47,6 +47,17 @@ describe("parser", () => {
47
47
) ;
48
48
} ) ;
49
49
50
+ it ( "encodes an event (with an integer as event name)" , ( done ) => {
51
+ helpers . test (
52
+ {
53
+ type : PacketType . EVENT ,
54
+ data : [ 1 , "a" , { } ] ,
55
+ nsp : "/" ,
56
+ } ,
57
+ done
58
+ ) ;
59
+ } ) ;
60
+
50
61
it ( "encodes an event (with ack)" , ( done ) => {
51
62
helpers . test (
52
63
{
You can’t perform that action at this time.
0 commit comments