import { ReadableApp } from "@scramjet/types" ; import { PassThrough } from "stream" ; param _stream export = async function ( _stream ) { const ps = new PassThrough ( ) ; let cnt = 0 ; let cnt2 = 0 ; setInterval ( async ( ) => { console . log ( cnt ) ; this . logger . log ( cnt ) ; if ( cnt === 0 ) { cnt = 60 ; console . error ( "Error stream test" , cnt ) ; } cnt -- ; } , 1000 ) ; setInterval ( async ( ) => { ps . write ( cnt2 + "\n" ) ; cnt2 ++ ; } , 500 ) ; return ps ; } as ReadableApp < any > ;