MCPcopy Create free account
hub / github.com/chakra-ui/panda / createCache

Function createCache

packages/extractor/src/unbox.ts:126–131  ·  view source on GitHub ↗
(map: CacheMap)

Source from the content-addressed store, hash-verified

124export const cacheMap: CacheMap = new WeakMap()
125
126const createCache = (map: CacheMap) => ({
127 value: map,
128 has: (node: BoxNodeType) => map.has(node as any),
129 get: (node: BoxNodeType) => map.get(node as any) as Unboxed | undefined,
130 set: (node: BoxNodeType, value: any) => map.set(node as any, value),
131})
132
133export const unbox = (node: BoxNodeType, ctx?: Pick<UnboxContext, 'cache'>): Unboxed => {
134 const _ctx: UnboxContext = {

Callers 1

unboxFunction · 0.85

Calls 3

hasMethod · 0.80
getMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected