(path: string)
| 217 | } |
| 218 | |
| 219 | async readFileBytes(path: string): Promise<Uint8Array> { |
| 220 | validatePath(path, "open"); |
| 221 | if (normalizePath(path) === "/") { |
| 222 | throw new Error( |
| 223 | `EISDIR: illegal operation on a directory, read '${path}'` |
| 224 | ); |
| 225 | } |
| 226 | const loc = this.locate(path, true, "open"); |
| 227 | if (!loc) throw this.missing("open", path); |
| 228 | if (loc.node.kind === "dir" || loc.node.kind === "symlink") { |
| 229 | throw new Error( |
| 230 | `EISDIR: illegal operation on a directory, read '${path}'` |
| 231 | ); |
| 232 | } |
| 233 | if (loc.node.kind === "lazy") return this.forceLazy(loc); |
| 234 | return loc.node.bytes; |
| 235 | } |
| 236 | |
| 237 | async writeFile( |
| 238 | path: string, |
no test coverage detected