import path from "path" ; import { LogLevel } from "./constants" ; export function resolveBoolean ( value ) { if ( value === "true" ) { return true ; } else if ( value === "false" ) { return false ; } return undefined ; } export function resolveList ( value ) { return value . split ( "," ) ; } export function resolvePath ( value ) { return path . resolve ( path . normalize ( value ) ) ; } export function resolveLogLevelKey ( value ) { return Object . keys ( LogLevel ) . find ( x => x . toLowerCase ( ) === value . toLowerCase ( ) ) ; } export function mergeObjects < TAObject extends object , TBObject extends object > ( a , b ) { const result = a as any ; for ( const key of Object . keys ( b ) ) { const value = ( b as any ) [ key ] ; if ( value == null ) { continue ; } result [ key ] = value ; } return result as TAObject & TBObject ; }