( messageText: string, )
| 433 | * Checks if a message text contains an idle notification |
| 434 | */ |
| 435 | export function isIdleNotification( |
| 436 | messageText: string, |
| 437 | ): IdleNotificationMessage | null { |
| 438 | try { |
| 439 | const parsed = jsonParse(messageText) |
| 440 | if (parsed && parsed.type === 'idle_notification') { |
| 441 | return parsed as IdleNotificationMessage |
| 442 | } |
| 443 | } catch { |
| 444 | // Not JSON or not a valid idle notification |
| 445 | } |
| 446 | return null |
| 447 | } |
| 448 | |
| 449 | /** |
| 450 | * Permission request message sent from worker to leader via mailbox. |
no test coverage detected