MCPcopy Index your code
hub / github.com/CapSoftware/Cap / parseJsonOutput

Function parseJsonOutput

scripts/verify-recording-pipeline.mjs:222–244  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

220}
221
222function parseJsonOutput(text) {
223 const trimmed = text.trim();
224 if (!trimmed) {
225 return null;
226 }
227
228 try {
229 return JSON.parse(trimmed);
230 } catch {}
231
232 return trimmed
233 .split(/\r?\n/)
234 .map((line) => line.trim())
235 .filter(Boolean)
236 .map((line) => {
237 try {
238 return JSON.parse(line);
239 } catch {
240 return null;
241 }
242 })
243 .filter(Boolean);
244}
245
246function findLastEvent(text, type) {
247 const parsed = parseJsonOutput(text);

Callers 6

findLastEventFunction · 0.85
getTargetsFunction · 0.85
validateProjectFunction · 0.85
probeMediaFunction · 0.85
exportProjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected