code: function getAliases(obj) {
    var names = {};
    if (obj.name) {
      names[obj.name] = true;
    }
    var aliases = obj.aliases;
    var i, l;
    for (i = 0, l = aliases.length; i < l; i++) {
      names[aliases[i]] = true;
    }
    return Object.keys(names);
  }
docs: Get all aliases for a type (including its name).
  
  @param obj {Type|Object} Typically a type or a field. Its aliases property
  must exist and be an array.