(path, options)
| 2131 | } |
| 2132 | |
| 2133 | async function readFile(path, options) { |
| 2134 | const h = vfsState.handlers; |
| 2135 | if (h !== null) { |
| 2136 | checkAborted(options?.signal); |
| 2137 | const result = h.readFile(path, options); |
| 2138 | if (result !== undefined) return result; |
| 2139 | } |
| 2140 | options = getOptions(options, { flag: 'r' }); |
| 2141 | validateReadFileBufferOptions(options); |
| 2142 | const flag = options.flag || 'r'; |
| 2143 | |
| 2144 | if (path instanceof FileHandle) |
| 2145 | return readFileHandle(path, options); |
| 2146 | |
| 2147 | checkAborted(options.signal); |
| 2148 | |
| 2149 | const fd = await open(path, flag, 0o666); |
| 2150 | return handleFdClose(readFileHandle(fd, options), fd.close); |
| 2151 | } |
| 2152 | |
| 2153 | async function* _watch(filename, options = kEmptyObject) { |
| 2154 | const h = vfsState.handlers; |
no test coverage detected
searching dependent graphs…