MCPcopy Create free account
hub / github.com/Noumena-Network/code / wrapCacheKey

Function wrapCacheKey

src/ink/wrap-text.ts:17–19  ·  view source on GitHub ↗
(text: string, maxWidth: number, wrapType: Styles['textWrap'])

Source from the content-addressed store, hash-verified

15const wrapCache = new LRUCache<string, string>({ max: MAX_WRAP_CACHE_ENTRIES })
16
17function 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.

Callers 1

wrapTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected