( transcript: SessionContentData["transcript"], )
| 88 | } |
| 89 | |
| 90 | function extractTranscriptText( |
| 91 | transcript: SessionContentData["transcript"], |
| 92 | ): string | null { |
| 93 | const transcripts = transcript?.transcripts ?? []; |
| 94 | const chunks = transcripts.flatMap((item) => { |
| 95 | const memo = typeof item.memo_md === "string" ? item.memo_md.trim() : ""; |
| 96 | if (memo) { |
| 97 | return [memo]; |
| 98 | } |
| 99 | |
| 100 | const words = item.words ?? []; |
| 101 | const text = normalizeWhitespace(words.map((word) => word.text).join(" ")); |
| 102 | return text ? [text] : []; |
| 103 | }); |
| 104 | |
| 105 | return chunks.length > 0 ? chunks.join("\n\n") : null; |
| 106 | } |
| 107 | |
| 108 | function buildNoteSections(payload: SessionContentData): NoteSection[] { |
| 109 | const sections: NoteSection[] = []; |
no test coverage detected