(stream, file)
| 77 | * @returns {Promise<void>} |
| 78 | */ |
| 79 | const saveStreamToFile = (stream, file) => |
| 80 | new Promise((resolve, reject) => { |
| 81 | const writable = stream.pipe(fs.createWriteStream(file)) |
| 82 | writable.once('finish', () => { |
| 83 | resolve() |
| 84 | writable.destroy() |
| 85 | }) |
| 86 | writable.once('error', () => { |
| 87 | reject() |
| 88 | writable.destroy() |
| 89 | }) |
| 90 | }) |
| 91 | |
| 92 | const kDestroyed = Symbol('kDestroyed') |
| 93 | const kIsReadable = Symbol('kIsReadable') |
nothing calls this directly
no outgoing calls
no test coverage detected