vue3-yuanma/packages/compiler-sfc/src/cache.ts

6 lines
172 B
TypeScript

export function createCache<T>(size = 500) {
return __GLOBAL__ || __ESM_BROWSER__
? new Map<string, T>()
: (new (require('lru-cache'))(size) as Map<string, T>)
}