import { transports , Logger } from "winston" ; param obj export function deepClone < T > ( obj ) { return JSON . parse ( JSON . stringify ( obj ) ) ; } param timeInSecond export const sleep = ( timeInMs ) : Promise < unknown > => { return new Promise ( ( resolve ) => { setTimeout ( ( ) => { resolve ( ) ; } , timeInMs ) ; } ) ; } ; export const turnOffConsoleLogging = ( logger ) : void => { if ( logger . level !== "silly" ) { logger . transports . forEach ( ( t ) => { if ( t instanceof transports . Console ) { t . silent = true ; } } ) ; } } ; export const turnOnConsoleLogging = ( logger ) : void => { logger . transports . forEach ( ( t ) => { if ( t instanceof transports . Console ) { t . silent = false ; } } ) ; } ;