-
-
Notifications
You must be signed in to change notification settings - Fork 280
Open
Labels
Description
Implementation would be easier for websockets if the library included pre-built type guards to narrow down types.
export function isWsFuturesUserDataEvent(
data: WsFormattedMessage
): data is WsMessageFuturesUserDataEventFormatted {
// The wsKey can be parsed to determine the type of message (what websocket it came from)
return !Array.isArray(data) && data.wsKey.includes('userData');
}
Could put these under util/typeGuards.ts