(p: string)
| 51 | return null; |
| 52 | }, |
| 53 | async readFile(p: string) { |
| 54 | const v = store.get(p); |
| 55 | if (v === undefined) throw Object.assign(new Error(`ENOENT: ${p}`), { code: 'ENOENT' }); |
| 56 | return v; |
| 57 | }, |
| 58 | async writeFile(p: string, data: string, opts?: { exclusive?: boolean }) { |
| 59 | if (opts?.exclusive && (store.has(p) || dirs.has(p) || symlinks.has(p))) { |
| 60 | throw Object.assign(new Error(`EEXIST: ${p}`), { code: 'EEXIST' }); |