Skip to content

SudoSOS Back-end API / service/websocket/room-parser / parseRoom

Function: parseRoom() ​

ts
function parseRoom(room): ParsedRoom;

Parses a room name into its components. Supports patterns:

  • {entity_type}:{entity_id}:{event_type} (e.g., "pos:123:transactions")
  • {entity_type}:{event_type} (e.g., "transactions:all") for global listeners
  • Pattern with {id} placeholder (e.g., "pos:{id}:transactions") for matching

Parameters ​

ParameterTypeDescription
roomstringThe room name to parse, or a pattern with {id} placeholder.

Returns ​

ParsedRoom

Parsed room information or null if invalid format.