import { BufferEncoding } from "@toruslabs/openlogin-utils" ; import { Duplex } from "readable-stream" ; export default class Substream extends Duplex { private readonly _parent : any ; private readonly _name : string ; constructor ( { parent , name } ) { super ( { objectMode : true } ) ; this . _parent = parent ; this . _name = name ; } /**
     * Explicitly sets read operations to a no-op.
     */ _read ( ) { return undefined ; } param chunk param encoding param callback _write ( chunk , _encoding , callback ) { this . _parent . push ( { name : this . _name , data : chunk , } ) ; callback ( ) ; } }