import type { IndexPattern } from '../../../../../src/plugins/data/common' ; import { isPopulatedObject } from '../shared_imports' ; export function isIndexPattern ( arg ) { return ( isPopulatedObject ( arg , [ 'title' , 'fields' ] ) && 'getComputedFields' in ( arg as IndexPattern ) && typeof ( arg as IndexPattern ) . getComputedFields === 'function' && typeof arg . title === 'string' && Array . isArray ( arg . fields ) ) ; }