(result: Record<string, unknown>)
| 19 | } |
| 20 | |
| 21 | export function toDaemonFindData(result: Record<string, unknown>): Record<string, unknown> { |
| 22 | if (result.kind === 'found') { |
| 23 | return { |
| 24 | found: true, |
| 25 | ...(typeof result.waitedMs === 'number' ? { waitedMs: result.waitedMs } : {}), |
| 26 | }; |
| 27 | } |
| 28 | return { |
| 29 | ...(typeof result.ref === 'string' ? { ref: result.ref } : {}), |
| 30 | ...(typeof result.text === 'string' ? { text: result.text } : {}), |
| 31 | ...(result.node && typeof result.node === 'object' ? { node: result.node } : {}), |
| 32 | }; |
| 33 | } |
| 34 | |
| 35 | export function buildGetRecordResult( |
| 36 | result: Record<string, unknown>, |
no outgoing calls
no test coverage detected