def json_decoder_to_deserializer(decoder_cls: Union[Type[JSONDecoder], Callable[[], Type[JSONDecoder]]]) \
        -> Type[Deserializer]:
    """
    Converts a `JSONDecoder` class into an equivalent `Deserializer` class.
    :param decoder_cls: the decoder class type or a function that returns the type
    :return: the equivalent `Deserializer` class
    """
    name = decoder_cls.__name__ if isinstance(decoder_cls, type) else "%sLambdaTypeReturn" % id(decoder_cls)
    return type(
        "%sAsDeserializer" % name,
        (_JSONDecoderAsDeserializer,),
        {
            "decoder_type": property(lambda self: decoder_cls if isinstance(decoder_cls, type) else decoder_cls())
        }
    )