(map: CacheMap)
| 124 | export const cacheMap: CacheMap = new WeakMap() |
| 125 | |
| 126 | const 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 | |
| 133 | export const unbox = (node: BoxNodeType, ctx?: Pick<UnboxContext, 'cache'>): Unboxed => { |
| 134 | const _ctx: UnboxContext = { |