(turns: readonly T[], topic: ChatTopic | undefined)
| 27 | * Coming back started fresh, so "Und was noch?" got "Ja, und noch." (B4). Replies without a |
| 28 | * topic (no context) belong to none. */ |
| 29 | export function topicHistory<T extends BrowserChatTurn>(turns: readonly T[], topic: ChatTopic | undefined): T[] { |
| 30 | return topic ? turns.filter(turn => turn.topic?.key === topic.key) : []; |
| 31 | } |
| 32 | |
| 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). */ |
no outgoing calls
no test coverage detected