(filename, syscall, fn)
| 124 | |
| 125 | // Sync read: check exists first, fall through to ENOENT for mounted VFS. |
| 126 | function findVFSWith(filename, syscall, fn) { |
| 127 | const normalized = resolve(filename); |
| 128 | for (let i = 0; i < activeVFSList.length; i++) { |
| 129 | const vfs = activeVFSList[i]; |
| 130 | if (vfs.shouldHandle(normalized)) { |
| 131 | if (vfs.existsSync(normalized)) { |
| 132 | return fn(vfs, normalized); |
| 133 | } |
| 134 | throw createENOENT(syscall, filename); |
| 135 | } |
| 136 | } |
| 137 | return undefined; |
| 138 | } |
| 139 | |
| 140 | function vfsRead(path, syscall, fn) { |
| 141 | const pathStr = toPathStr(path); |
no test coverage detected
searching dependent graphs…