refactor: use correct type for BroadcastOptions#except

The 'except' attribute is a set of room IDs, which is then converted to
a set of socket IDs in the computeExceptSids() method.

That wasn't caught because both types are aliases for 'string', but
Room could be extended to all primitive values in the future.

Reference: https://developer.mozilla.org/en-US/docs/Glossary/Primitive

Related: https://github.com/socketio/socket.io-adapter/issues/82
This commit is contained in:
Damien Arrachequesne
2022-05-25 07:03:47 +02:00
parent b92d65cf9c
commit 3410584a93

View File

@@ -16,7 +16,7 @@ export interface BroadcastFlags {
export interface BroadcastOptions {
rooms: Set<Room>;
except?: Set<SocketId>;
except?: Set<Room>;
flags?: BroadcastFlags;
}