export interface CidrMaskIpRangeAggKey { type : 'mask' ; mask : string ; } export interface RangeIpRangeAggKey { type : 'range' ; from : string ; to : string ; } export type IpRangeKey = CidrMaskIpRangeAggKey | RangeIpRangeAggKey ; export const convertIPRangeToString = ( range , format ) => { if ( range . type === 'mask' ) { return format ( range . mask ) ; } const from = range . from ? format ( range . from ) : '-Infinity' ; const to = range . to ? format ( range . to ) : 'Infinity' ; return `${ from } to ${ to }` ; } ;