import { reduce } from 'lodash' ; export const convertECSMappingToArray = ( ecsMapping ) => ecsMapping ? Object . entries ( ecsMapping ) . map ( ( item ) => ( { key : item [ 0 ] , value : item [ 1 ] , } ) ) : undefined ; export const convertECSMappingToObject = ( ecsMapping ) => reduce ( ecsMapping , ( acc , value ) => { acc [ value . key ] = value . value ; return acc ; } , { } as Record < string , { field ? : string ; value ? : string ; } > ) ;