MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / isLiveLogMessage

Function isLiveLogMessage

src/lib/sse-io.ts:28–36  ·  view source on GitHub ↗
(event: unknown)

Source from the content-addressed store, hash-verified

26}
27
28export const isLiveLogMessage = (event: unknown): event is LiveLogMessage => {
29 const liveLogEvent = event as LiveLogMessage
30 return liveLogEvent && typeof liveLogEvent === 'object' &&
31 typeof liveLogEvent.timestamp === 'string' &&
32 typeof liveLogEvent.driver_id === 'string' &&
33 typeof liveLogEvent.driver_name === 'string' &&
34 typeof liveLogEvent.log_level === 'number' &&
35 typeof liveLogEvent.message === 'string'
36}
37
38/**
39 * This controls how every Server-sent event is formatted to the console in the CLI.

Callers 2

parseEventFunction · 0.85
sse-io.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected