Function
wrapCacheKey
(text: string, maxWidth: number, wrapType: Styles['textWrap'])
Source from the content-addressed store, hash-verified
| 15 | const wrapCache = new LRUCache<string, string>({ max: MAX_WRAP_CACHE_ENTRIES }) |
| 16 | |
| 17 | function wrapCacheKey(text: string, maxWidth: number, wrapType: Styles['textWrap']): string { |
| 18 | return `${wrapType ?? 'wrap'}:${maxWidth}:${text}` |
| 19 | } |
| 20 | |
| 21 | // sliceAnsi may include a boundary-spanning wide char (e.g. CJK at position |
| 22 | // end-1 with width 2 overshoots by 1). Retry with a tighter bound once. |
Tested by
no test coverage detected