MCPcopy Create free account
hub / github.com/Noumena-Network/code / looksLikeJsonlTranscript

Function looksLikeJsonlTranscript

src/utils/ccshareResume.ts:273–289  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

271}
272
273function looksLikeJsonlTranscript(value: string): boolean {
274 const firstLine = value
275 .split('\n')
276 .map(line => line.trim())
277 .find(line => line.length > 0)
278
279 if (!firstLine) {
280 return false
281 }
282
283 try {
284 const parsed = jsonParse(firstLine)
285 return isSerializedTranscriptMessageLike(parsed)
286 } catch {
287 return false
288 }
289}
290
291function isRecord(value: unknown): value is RecordLike {
292 return value !== null && typeof value === 'object' && !Array.isArray(value)

Callers 2

parseTransportPayloadFunction · 0.85

Calls 2

jsonParseFunction · 0.85

Tested by

no test coverage detected