import { SavedObjectsMappingProperties , IndexMapping } from '../../mappings' ; param activeMappings param sourceMappings returns export function disableUnknownTypeMappingFields ( activeMappings , sourceMappings ) { const targetTypes = Object . keys ( activeMappings . properties ) ; const disabledTypesProperties = Object . keys ( sourceMappings . properties ?? { } ) . filter ( ( sourceType ) => { const isObjectType = 'properties' in sourceMappings . properties [ sourceType ] ; return ! targetTypes . includes ( sourceType ) && isObjectType ; } ) . reduce ( ( disabledTypesAcc , sourceType ) => { disabledTypesAcc [ sourceType ] = { dynamic : false , properties : { } } ; return disabledTypesAcc ; } , { } as SavedObjectsMappingProperties ) ; return { ... activeMappings , properties : { ... sourceMappings . properties , ... disabledTypesProperties , ... activeMappings . properties , } , } ; }