(value: unknown)
| 105 | } |
| 106 | |
| 107 | function readNode(value: unknown): TraceNode { |
| 108 | const record = isRecord(value) ? value : {}; |
| 109 | const node: TraceNode = { name: text(record['name']) }; |
| 110 | const id = num(record['id']); |
| 111 | if (id !== undefined) { |
| 112 | node.id = id; |
| 113 | } |
| 114 | const filePath = text(record['file_path']); |
| 115 | if (filePath.length > 0) { |
| 116 | node.filePath = filePath; |
| 117 | } |
| 118 | const observed = readObserved(record['observed']); |
| 119 | if (observed !== undefined) { |
| 120 | node.observed = observed; |
| 121 | } |
| 122 | return node; |
| 123 | } |
| 124 | |
| 125 | export function readTraceAnswer(raw: unknown): TraceAnswer { |
| 126 | const record = isRecord(raw) ? raw : {}; |
no test coverage detected