diff options
Diffstat (limited to 'src/util/cache.ts')
| -rw-r--r-- | src/util/cache.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util/cache.ts b/src/util/cache.ts index 3a0c5d4..df52f89 100644 --- a/src/util/cache.ts +++ b/src/util/cache.ts @@ -1,5 +1,8 @@ import { join } from "https://deno.land/[email protected]/path/mod.ts"; -import { ensureDirSync } from "https://deno.land/[email protected]/fs/mod.ts"; +import { + ensureDirSync, + existsSync, +} from "https://deno.land/[email protected]/fs/mod.ts"; import { environment } from "../environment/environment.ts"; export class Cache { @@ -36,4 +39,8 @@ export class Cache { return undefined; } } + + public exists(name: string, extension?: string) { + return existsSync(join(this.path, `${name}${extension}`)); + } } |
