estimateJsonObjectValueType function Null safety

TypedJsonObjectValueType estimateJsonObjectValueType(
  1. Map<String, dynamic> jsonObject
)

Converts a JSON object into a TypedJsonObjectValueType.

This function will estimate the value type of each field in the given jsonObject. More accurate results may be achieved by using multiple samples of the same type of JSON object with estimateJsonObjectsValueType.

Implementation

TypedJsonObjectValueType estimateJsonObjectValueType(
  Map<String, dynamic> jsonObject,
) =>
    TypedJsonObjectValueType(
      fieldValueTypes: jsonObject.map(
        (key, value) => MapEntry(key, estimateJsonFieldValueType(key, value)),
      ),
      optional: false,
    );