All files / compiler-sfc/src cache.ts

100% Statements 3/3
80% Branches 4/5
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 87x   7x 14x        
import LRU from 'lru-cache'
 
export function createCache<T>(size = 500) {
  return __GLOBAL__ || __ESM_BROWSER__
    ? new Map<string, T>()
    : (new LRU(size) as any as Map<string, T>)
}