(value: unknown)
| 86 | } |
| 87 | |
| 88 | function isDaemonRegistryEntry(value: unknown): value is DaemonRegistryEntry { |
| 89 | if (typeof value !== 'object' || value === null) { |
| 90 | return false; |
| 91 | } |
| 92 | |
| 93 | const entry = value as Partial<DaemonRegistryEntry>; |
| 94 | return ( |
| 95 | typeof entry.workspaceKey === 'string' && |
| 96 | entry.workspaceKey.length > 0 && |
| 97 | typeof entry.workspaceRoot === 'string' && |
| 98 | typeof entry.socketPath === 'string' && |
| 99 | (entry.logPath === undefined || typeof entry.logPath === 'string') && |
| 100 | typeof entry.pid === 'number' && |
| 101 | Number.isInteger(entry.pid) && |
| 102 | entry.pid > 0 && |
| 103 | typeof entry.startedAt === 'string' && |
| 104 | Array.isArray(entry.enabledWorkflows) && |
| 105 | entry.enabledWorkflows.every((workflow) => typeof workflow === 'string') && |
| 106 | typeof entry.version === 'string' && |
| 107 | (entry.instanceId === undefined || |
| 108 | (typeof entry.instanceId === 'string' && entry.instanceId.length > 0)) |
| 109 | ); |
| 110 | } |
| 111 | |
| 112 | type RegistryReadResult = |
| 113 | | { status: 'missing' } |
no outgoing calls
no test coverage detected