(text: string | undefined)
| 165 | } |
| 166 | |
| 167 | function normalizeQueueText(text: string | undefined): string | undefined { |
| 168 | if (!text) { |
| 169 | return undefined |
| 170 | } |
| 171 | |
| 172 | const compact = text.replace(/\s+/g, " ").trim() |
| 173 | if (!compact) { |
| 174 | return undefined |
| 175 | } |
| 176 | |
| 177 | return compact.length <= 180 ? compact : `${compact.slice(0, 177)}...` |
| 178 | } |
| 179 | |
| 180 | function parseQueueSnapshot(rawQueue: unknown): StreamQueueItem[] | undefined { |
| 181 | if (!Array.isArray(rawQueue)) { |
no test coverage detected