import { DataTypeConfig , DataTypeFields , FieldType } from '@terascope/types' ; import { DataTypeFieldAndChildren } from '../function-configs/interfaces' ; import { getChildDataTypeConfig } from '../core' ; export function getDataTypeFieldAndChildren ( config , field ) { if ( ! field || ! config ) return ; const fieldConfig = config . fields [ field ] ; if ( ! fieldConfig ) return ; const childConfig = getChildDataTypeConfig ( config . fields , field , fieldConfig . type as FieldType ) ; return { field_config : fieldConfig , child_config : childConfig } ; }