import { IIndexPattern , IFieldType } from '../../index_patterns' ; import { Filter } from '../filters' ; export function filterMatchesIndex ( filter , indexPattern ? ) { if ( ! filter . meta ?. key || ! indexPattern ) { return true ; } return indexPattern . fields . some ( ( field ) => field . name === filter . meta . key ) ; }