discord-authorize
Version:
A node module for easy authentication with Discord
21 lines • 862 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.totalGuildCount = void 0;
const getType_1 = __importDefault(require("./getType"));
/**
* Returns the total guild count of a user.
* @param guildArray - An array of guild objects.
* @returns The total count of guilds.
* @throws {TypeError} If the input is not an array of guild objects.
*/
const totalGuildCount = (guildArray) => {
if ((0, getType_1.default)(guildArray) !== "array") {
throw new TypeError(`Guild array must be an array of guild objects, but got ${(0, getType_1.default)(guildArray)}`);
}
return guildArray.length + 1;
};
exports.totalGuildCount = totalGuildCount;
//# sourceMappingURL=Guild.js.map