code: function toTypeRef(type) {
      if (!type) {
        return (0, _typeOf.typeOf)(type);
      } else if (type.constructor === String || type instanceof Function) {
        return type;
      }
  
      return (0, _typeOf.typeOf)(type);
    }
docs: Resolves/normalizes a type name from either a string or a constructor.
  @function module:object.toTypeRef
  @param type {Function|String} - String or function representing a type.
  @returns {String}
  @todo write tests for this function.