import { UNITS } from './units' ; import { Duration } from '../types' ; export const cleanDurationObject = ( duration ) : Readonly < Duration > => { const output = { ... duration } ; UNITS . forEach ( key => { if ( output [ key ] === 0 ) { output [ key ] = 0 ; } } ) ; return output ; } ;