(cacheDir: string, key: string)
| 21 | } |
| 22 | |
| 23 | async 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 | |
| 31 | async function initEntries( |
| 32 | cacheDir: string |
no test coverage detected