export function filterMapRecord < T , V > ( object , mapper ) { if ( ! object ) { return ; } const result = { } as Record < string , V > ; for ( const [ key , value ] of Object . entries ( object ) ) { const newValue = mapper ( key , value ) ; if ( newValue !== undefined ) { result [ key ] = newValue ; } } return result ; } export function isEmptyRecord ( o ) { return ! o || ! Object . keys ( o ) . length ; }