index.js
function (type) {
   if (type === null) return true;
   if (type === undefined) return true;
   if (type instanceof AnyType) return true;
   if (type instanceof Array) {
      // An array is only valid if it contains one or more valid types.
      if (!type.length) return false;
      for (var i = 0; i < type.length; i++) {
          if (!isValidType(type[i])) return false;
      };
      return true;
   }
   if (type instanceof ArrayOf) return isValidType(type.type);
   if (type instanceof EnumType) return (type.enumerable instanceof Object);
   return (type instanceof Object);
}
function (type) {
   if (type === null) return true;
   if (type === undefined) return true;
   if (type instanceof AnyType) return true;
   if (type instanceof Array) {
      // An array is only valid if it contains one or more valid types.
      if (!type.length) return false;
      for (var i = 0; i < type.length; i++) {
          if (!isValidType(type[i])) return false;
      };
      return true;
   }
   if (type instanceof ArrayOf) return isValidType(type.type);
   if (type instanceof EnumType) return (type.enumerable instanceof Object);
   return (type instanceof Object);
}
Determines if the argument is a valid type.
@param {type} type
@return {boolean}