import { ByteSizeValue } from '@kbn/config-schema' ; import moment from 'moment' ; export const durationToNumber = ( value ) : number => { if ( typeof value === 'number' ) { return value ; } return value . asMilliseconds ( ) ; } ; export const numberToDuration = ( value ) : moment . Duration => { if ( typeof value === 'number' ) { return moment . duration ( value , 'milliseconds' ) ; } return value ; } ; export const byteSizeValueToNumber = ( value ) => { if ( typeof value === 'number' ) { return value ; } return value . getValueInBytes ( ) ; } ;