socket.ts (socket.io-client-4.5.1) | : | socket.ts (socket.io-client-4.5.2) | ||
---|---|---|---|---|
skipping to change at line 171 | skipping to change at line 171 | |||
* If the event is in `events`, it's emitted normally. | * If the event is in `events`, it's emitted normally. | |||
* | * | |||
* @return self | * @return self | |||
* @public | * @public | |||
*/ | */ | |||
public emit<Ev extends EventNames<EmitEvents>>( | public emit<Ev extends EventNames<EmitEvents>>( | |||
ev: Ev, | ev: Ev, | |||
...args: EventParams<EmitEvents, Ev> | ...args: EventParams<EmitEvents, Ev> | |||
): this { | ): this { | |||
if (RESERVED_EVENTS.hasOwnProperty(ev)) { | if (RESERVED_EVENTS.hasOwnProperty(ev)) { | |||
throw new Error('"' + ev + '" is a reserved event name'); | throw new Error('"' + ev.toString() + '" is a reserved event name'); | |||
} | } | |||
args.unshift(ev); | args.unshift(ev); | |||
const packet: any = { | const packet: any = { | |||
type: PacketType.EVENT, | type: PacketType.EVENT, | |||
data: args, | data: args, | |||
}; | }; | |||
packet.options = {}; | packet.options = {}; | |||
packet.options.compress = this.flags.compress !== false; | packet.options.compress = this.flags.compress !== false; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |