UNPKG

@file-cache/core

Version:

A cache for file metadata or file content.

24 lines (22 loc) 768 B
import { CacheInterface } from "./CacheInterface.js"; export const createNoCache = (): CacheInterface => { return { async clear(): Promise<void> { return; }, // eslint-disable-next-line @typescript-eslint/no-unused-vars async delete(_filePath: string): Promise<boolean> { return true; }, // eslint-disable-next-line @typescript-eslint/no-unused-vars async getAndUpdateCache(_filePath: string | URL): Promise<{ error?: Error; changed: boolean }> { return { changed: true }; }, async reconcile(): Promise<boolean> { return true; }, async try(cb: () => Promise<void>): Promise<void> { return cb(); } }; };