MCPcopy
hub / github.com/vercel/next.js / readEntry

Function readEntry

test/unit/image-optimizer/lru-disk-eviction.test.ts:23–29  ·  view source on GitHub ↗
(cacheDir: string, key: string)

Source from the content-addressed store, hash-verified

21}
22
23async function readEntry(cacheDir: string, key: string) {
24 const dir = join(cacheDir, key)
25 const [file] = await promises.readdir(dir)
26 const buffer = await promises.readFile(join(dir, file))
27 const [expireAtStr] = file.split('.')
28 return { size: buffer.byteLength, expireAt: Number(expireAtStr) }
29}
30
31async function initEntries(
32 cacheDir: string

Callers 1

initEntriesFunction · 0.85

Calls 3

joinFunction · 0.90
splitMethod · 0.80
readFileMethod · 0.45

Tested by

no test coverage detected