* If streaming, then the stack is "sticky"
(
stickyStack: StickyStackElement[],
token: string,
data: string | number,
)
| 484 | * If streaming, then the stack is "sticky" |
| 485 | */ |
| 486 | function updateStickyStack( |
| 487 | stickyStack: StickyStackElement[], |
| 488 | token: string, |
| 489 | data: string | number, |
| 490 | ): StickyStackElement[] { |
| 491 | if (token !== 'text' && token !== 'url') { |
| 492 | stickyStack = stickyStack.filter(notCategory(categoryForCode(data))); |
| 493 | stickyStack.push({ |
| 494 | token: token, |
| 495 | data: data, |
| 496 | category: categoryForCode(data), |
| 497 | }); |
| 498 | } |
| 499 | |
| 500 | return stickyStack; |
| 501 | } |
| 502 | |
| 503 | export class Filter { |
| 504 | private readonly opts: AnsiToHtmlOptions; |
no test coverage detected