transform.destroy([error])
销毁流,并可选择触发 'error' 事件。调用此方法后,转换流将释放任何内部资源。实现者不应重写此方法,而应实现 readable._destroy()。Transform 的 _destroy() 默认实现也会触发 'close',除非 emitClose 设置为 false。
🌐 Destroy the stream, and optionally emit an 'error' event. After this call, the
transform stream would release any internal resources.
Implementors should not override this method, but instead implement
readable._destroy().
The default implementation of _destroy() for Transform also emit 'close'
unless emitClose is set in false.
一旦调用了 destroy(),任何后续调用都将不会有任何作用,并且除了 _destroy() 外,不会再触发 'error' 错误。
🌐 Once destroy() has been called, any further calls will be a no-op and no
further errors except from _destroy() may be emitted as 'error'.