(id: string)
| 139 | } |
| 140 | |
| 141 | async function remove(id: string): Promise<void> { |
| 142 | const path = fileFor(id); |
| 143 | try { |
| 144 | await unlink(path); |
| 145 | } catch (error) { |
| 146 | if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | return { write, read, list, remove }; |
| 151 | } |