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

Function getSharedCharCache

src/ink/output.ts:52–61  ·  view source on GitHub ↗
(stylePool: StylePool)

Source from the content-addressed store, hash-verified

50let sharedCharCaches = new WeakMap<StylePool, Map<string, ClusteredChar[]>>()
51
52function getSharedCharCache(stylePool: StylePool): Map<string, ClusteredChar[]> {
53 const existing = sharedCharCaches.get(stylePool)
54 if (existing) {
55 return existing
56 }
57
58 const cache = new Map<string, ClusteredChar[]>()
59 sharedCharCaches.set(stylePool, cache)
60 return cache
61}
62
63export function resetSharedOutputCharCachesForTesting(): void {
64 sharedCharCaches = new WeakMap()

Callers 1

constructorMethod · 0.85

Calls 2

setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected