code: function removeBrackets(type, nullOrUndefinedOnly) {
    if(typeof nullOrUndefinedOnly === "undefined") {
      nullOrUndefinedOnly = false;
    }
    if (typeof type === 'object') {
      return 'object';
    }
    else if(type.replace(/ /g, '') !== type) {
      return removeBrackets(type.replace(/ /g, ''));
    }
    else if(type.indexOf('null|') === 0) {
      return removeBrackets(type.substr('null|'.length));
    }
    else if(type.indexOf('undefined|') === 0) {
      // Not used currently, but robust code is better code :)
      return removeBrackets(type.substr('undefined|'.length));
    }
    if (type == null || type.length === 0 || nullOrUndefinedOnly) {
      return type;
    }
    var pos = type.indexOf('Array<');
    if (pos >= 0) {
      var start = 'Array<'.length;
      return type.substr(start, type.length - start - 1);
    }
    pos = type.indexOf('[');
    return pos >= 0 ? type.substr(0, pos) : type;
  }
docs: Removes an array designation from the given type.
  For example, "Array<a>" returns "a", "a[]" returns "a", while "b" returns "b".
  A special case is for inline objects. In this case, the result is "object".