import { SavedObjectsFieldMapping , IndexMapping , SavedObjectsMappingProperties } from '../types' ; import { getRootProperties } from './get_root_properties' ; param { EsMappingsDsl } mappings return { EsPropertyMappings } const omittedRootProps = [ 'migrationVersion' , 'references' ] ; export function getRootPropertiesObjects ( mappings ) { const rootProperties = getRootProperties ( mappings ) ; return Object . entries ( rootProperties ) . reduce ( ( acc , [ key , value ] ) => { if ( ! omittedRootProps . includes ( key ) && ( ( value as SavedObjectsFieldMapping ) . properties || value . type === 'object' ) ) { acc [ key ] = value ; } return acc ; } , { } as SavedObjectsMappingProperties ) ; }