(fd)
| 147 | }; |
| 148 | |
| 149 | function nodeFsync(fd) { |
| 150 | try { |
| 151 | fs.fsyncSync(fd); |
| 152 | } catch (e) { |
| 153 | if (e?.code === "EINVAL") { |
| 154 | return; |
| 155 | } |
| 156 | // On Mac, calling fsync when not isatty returns ENOTSUP |
| 157 | // On Windows, stdin/stdout/stderr may be closed, returning EBADF or EPERM |
| 158 | if ( |
| 159 | e?.code === "ENOTSUP" || e?.code === "EBADF" || e?.code === "EPERM" |
| 160 | ) { |
| 161 | return; |
| 162 | } |
| 163 | |
| 164 | throw e; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | class NodeReader { |
| 169 | constructor(nodeStream) { |