import inferElementFromValues from './inferElementFromValues' ; import getValuesFromRecords from './getValuesFromRecords' ; import { InferredTypeMap } from './types' ; example export default ( records , types ) => { const fieldValues = getValuesFromRecords ( records ) ; return Object . keys ( fieldValues ) . reduce ( ( fields , fieldName ) => fields . concat ( inferElementFromValues ( fieldName , fieldValues [ fieldName ] , types ) ) , [ ] ) . filter ( inferredElement => inferredElement . isDefined ( ) ) ; } ;