()
| 17 | constructor(private file: string = DEFAULT_FILE) {} |
| 18 | |
| 19 | private async load(): Promise<void> { |
| 20 | if (this.loaded) return; |
| 21 | try { this.map = JSON.parse(await fs.readFile(this.file, 'utf-8')); } |
| 22 | catch { this.map = {}; } |
| 23 | this.loaded = true; |
| 24 | } |
| 25 | |
| 26 | async get(key: string): Promise<string | undefined> { |
| 27 | await this.load(); |
no outgoing calls
no test coverage detected