| 95 | } |
| 96 | |
| 97 | export class TerminalizerParser implements ICastParser { |
| 98 | public parse(text: string): ICastObject { |
| 99 | const j = JSON.parse(text) |
| 100 | const records: Array<{ delay: number; content: string }> = j.records |
| 101 | |
| 102 | let timestamp = 0.0 |
| 103 | const events = records.map(rec => { |
| 104 | timestamp += rec.delay |
| 105 | return { |
| 106 | time: timestamp, |
| 107 | type: 'o', |
| 108 | data: rec.content |
| 109 | } |
| 110 | }) |
| 111 | |
| 112 | return { |
| 113 | header: { |
| 114 | version: 1, |
| 115 | width: j.config.cols, |
| 116 | height: j.config.rows, |
| 117 | duration: timestamp |
| 118 | }, |
| 119 | events |
| 120 | } |
| 121 | } |
| 122 | } |
nothing calls this directly
no outgoing calls
no test coverage detected