(turns: readonly BrowserChatTurn[], index: number)
| 33 | /** The divider above turn `index`: "new" for the first turn about another topic, "back" for |
| 34 | * a topic that has earlier turns, nothing within a topic (B4). */ |
| 35 | export function topicDivider(turns: readonly BrowserChatTurn[], index: number): 'new' | 'back' | undefined { |
| 36 | const topic = turns[index]?.topic; |
| 37 | if (!topic || index === 0) return undefined; |
| 38 | const earlier = turns.slice(0, index); |
| 39 | if ([...earlier].reverse().find(item => item.topic)?.topic?.key === topic.key) return undefined; |
| 40 | return earlier.some(item => item.topic?.key === topic.key) ? 'back' : 'new'; |
| 41 | } |
| 42 | |
| 43 | /** Follow-ups that ask nothing of their own: they continue the answer before (B4). */ |
| 44 | const FOLLOW_UPS = new Set(['und', 'and', 'mehr', 'more', 'noch mehr', 'und mehr', 'and more', 'mehr davon', 'more of that', 'mehr details', 'more details', 'details', |
no outgoing calls
no test coverage detected