transform.destroy([error])


销毁流,并可选择地触发 'error' 事件。 在此调用之后,转换流将释放任何内部资源。 实现者不应覆盖此方法,而应实现 readable._destroy()Transform_destroy() 的默认实现也会触发 'close',除非 emitClose 设置为 false。

一旦 destroy() 被调用,任何进一步的调用都将是空操作,并且除了来自 _destroy() 的其他错误不会作为 'error' 触发。

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.

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'.