| 282 | }, |
| 283 | end(chunk, encoding, callback) { |
| 284 | const writeComplete = error => { |
| 285 | if (error) { |
| 286 | callback(error); |
| 287 | } else { |
| 288 | this._flush(); |
| 289 | this.pipes.forEach(pipe => { |
| 290 | pipe.end(); |
| 291 | }); |
| 292 | this.emit('finish'); |
| 293 | } |
| 294 | }; |
| 295 | if (chunk) { |
| 296 | this.write(chunk, encoding, writeComplete); |
| 297 | } else { |