function resolve(opt) {
	if (isObject(opt) && isInheritedClass(opt, Serializers.Base)) {
		return opt;
	} else if (isString(opt)) {
		let SerializerClass = getByName(opt);
		if (SerializerClass) return new SerializerClass();
		else throw new BrokerOptionsError(`Invalid serializer type '${opt}'.`, { type: opt });
	} else if (isObject(opt)) {
		let SerializerClass = getByName(opt.type || "JSON");
		if (SerializerClass) return new SerializerClass(opt.options);
		else
			throw new BrokerOptionsError(`Invalid serializer type '${opt.type}'.`, {
				type: opt.type
			});
	}

	return new Serializers.JSON();
}
Resolve serializer by name

@param {object|string} opt
@returns {Serializer}
@memberof ServiceBroker