import { Writable } from "stream" ; name function param filteringLoggerName param out { Stream } return { WritableStream } const filteringHttpLogsStream = ( filteringLoggerName , out ) => { const shouldBeFiltered = ( chunk ) : boolean => { return ! ! chunk . toString ( ) . match ( `${ filteringLoggerName }.*(GET|POST|DELETE|PUT|PATCH) /` ) ; } ; const writable = new Writable ( { write : function ( chunk , encoding , next ) { if ( ! shouldBeFiltered ( chunk ) ) { out . write ( chunk , encoding ) ; } next ( ) ; } } ) ; return writable ; } ; export default filteringHttpLogsStream ;