(file: string)
| 36 | } |
| 37 | |
| 38 | get(file: string): MemoryFile | undefined { |
| 39 | const result = this.files.get(file) |
| 40 | if (result === undefined) { |
| 41 | return undefined |
| 42 | } |
| 43 | if (typeof result === 'function') { |
| 44 | const content = result() |
| 45 | this.files.set(file, content) |
| 46 | return content |
| 47 | } |
| 48 | return result |
| 49 | } |
| 50 | |
| 51 | set(file: string, content: MemoryFile | (() => MemoryFile)): void { |
| 52 | this.files.set(file, content) |