serialize method

Object? serialize(
  1. Serializers serializers,
  2. T object, {
  3. FullType specifiedType = FullType.unspecified,
})

Implementation

Object? serialize(Serializers serializers, T object,
    {FullType specifiedType = FullType.unspecified}) {
  final Serializer<T> serializer = this.serializer;
  if (serializer is PrimitiveSerializer<T>) {
    return serializer.serialize(serializers, object, specifiedType: specifiedType);
  } else if (serializer is StructuredSerializer<T>) {
    return serializer.serialize(serializers, object, specifiedType: specifiedType);
  } else {
    return object;
  }
}