code: func (v ElementBuildingVisitor) typeElement(meta apply.FieldMetaImpl, item *typeItem) (*apply.TypeElement, error) {
  	// Function to get the schema of a field from its key
  	var fn schemaFn = func(key string) proto.Schema {
  		if item.Type != nil && item.Type.Fields != nil {
  			return item.Type.Fields[key]
  		}
  		return nil
  	}
  
  	// Collect same fields from multiple maps into a map of elements
  	values, err := v.createMapValues(fn, meta, item.MapElementData)
  	if err != nil {
  		return nil, err
  	}
  
  	// Return the result
  	return &apply.TypeElement{
  		FieldMetaImpl:  meta,
  		MapElementData: item.MapElementData,
  		Values:         values,
  	}, nil
  }
docs: // typeElement builds a new mapElement from a typeItem