import { UNITS } from './lib/units' ; import { Duration , DurationInput } from './types' ; import { parse } from './parse' ; example export const negate = ( duration ) : Duration => { const output = { ... parse ( duration ) } ; UNITS . forEach ( unit => { output [ unit ] = output [ unit ] === 0 ? 0 : - output [ unit ] ; } ) ; return output ; } ;