(msg: RenderableMessage)
| 24 | * .toLowerCase()d the result, re-lowering ~1.5MB on every keystroke |
| 25 | * (the backspace hang). Returns '' for non-searchable types. */ |
| 26 | export function renderableSearchText(msg: RenderableMessage): string { |
| 27 | const cached = searchTextCache.get(msg) |
| 28 | if (cached !== undefined) return cached |
| 29 | const result = computeSearchText(msg).toLowerCase() |
| 30 | searchTextCache.set(msg, result) |
| 31 | return result |
| 32 | } |
| 33 | |
| 34 | function computeSearchText(msg: RenderableMessage): string { |
| 35 | let raw = '' |
no test coverage detected