UNPKG

corde

Version:

A simple library for Discord bot tests

79 lines (58 loc) 1.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true, }); exports.ConfigAPI = void 0; const consts_1 = require("../consts"); class ConfigAPI { constructor(_internalConfigs) { this._internalConfigs = _internalConfigs; } get cordeBotToken() { return this._internalConfigs.cordeBotToken; } get botTestId() { return this._internalConfigs.botTestId; } get channelId() { return this._internalConfigs.channelId; } get guildId() { return this._internalConfigs.guildId; } get timeout() { return this._internalConfigs.timeout ?? consts_1.DEFAULT_CONFIG.timeout; } get botPrefix() { return this._internalConfigs.botPrefix; } get testMatches() { return [...this._internalConfigs.testMatches]; } get modulePathIgnorePatterns() { const modulePathIgnorePatterns = this._internalConfigs.modulePathIgnorePatterns; if (modulePathIgnorePatterns) { return [...modulePathIgnorePatterns]; } return [...consts_1.DEFAULT_CONFIG.modulePathIgnorePatterns]; } get project() { return this._internalConfigs.project ?? consts_1.DEFAULT_CONFIG.project; } get exitOnFileReadingError() { return ( this._internalConfigs.exitOnFileReadingError ?? consts_1.DEFAULT_CONFIG.exitOnFileReadingError ); } get extensions() { const extension = this._internalConfigs.extensions; if (extension) { return [...extension]; } return [...consts_1.DEFAULT_CONFIG.extensions]; } get rootDir() { return this._internalConfigs.rootDir ?? consts_1.DEFAULT_CONFIG.rootDir; } } exports.ConfigAPI = ConfigAPI;