MCPcopy Index your code
hub / github.com/JavaCS3/xterm-player / TerminalizerParser

Class TerminalizerParser

src/CastParser.ts:97–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected