diff options
| author | Fridon <[email protected]> | 2022-06-23 00:01:12 +0400 |
|---|---|---|
| committer | Fridon <[email protected]> | 2022-06-23 00:01:12 +0400 |
| commit | 7d72153d68ea4c682266f0301aa45b4e3a9e45a9 (patch) | |
| tree | ba2b4b8937d0c7785a468fae18880762a5e6b484 /src/util/cache.ts | |
| parent | be829dad070205555c514ff497fcf2eae355a6e2 (diff) | |
| download | countryfetch-7d72153d68ea4c682266f0301aa45b4e3a9e45a9.tar.xz countryfetch-7d72153d68ea4c682266f0301aa45b4e3a9e45a9.zip | |
big refactor + raw option
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}`)); + } } |
