import { Duration , DurationInput } from './types' ; import { UNITS , ZERO } from './lib/units' ; import { parse } from './parse' ; example export const sum = ( ... durations ) : Duration => { const output = { ... ZERO } ; durations . map ( parse ) . forEach ( duration => { UNITS . forEach ( key => { output [ key ] += duration [ key ] ; } ) ; } ) ; return output ; } ;