async process() { try { let issues = await Promise.all(this.repositories.map(async repository => await this.getIssues(repository))); issues = issues.filter(issueArray => issueArray.length > 0).flat().flat(); const groupedIssues = this.groupIssues(issues); const bot = new BotService(this.context); await bot.sendData(groupedIssues); } catch ({ message }) { this.context.error(message) } }
/** * @typedef {Object} EmbedFieldData * @property {StringResolvable} name The name of this field * @property {StringResolvable} value The value of this field * @property {boolean} [inline] If this field will be displayed inline */ /** * Normalizes field input and resolves strings. * @param {...EmbedFieldData|EmbedFieldData[]} fields Fields to normalize * @returns {EmbedField[]} */ static normalizeFields(...fields) { return fields .flat(2) .map(field => this.normalizeField( field && field.name, field && field.value, field && typeof field.inline === 'boolean' ? field.inline : false, ), ); }
get footer() { const links = this.links; return (links.length || this.hasSettings) && BDV2.react.createElement("div", {className: "bd-card-footer bda-footer"}, BDV2.react.createElement("span", {className: "bd-addon-links bda-links"}, ...(links.map((element, index) => index < links.length - 1 ? [element, " | "] : element).flat()) ), this.hasSettings && BDV2.react.createElement("button", {onClick: this.showSettings, className: "bd-button bda-settings-button", disabled: !this.state.checked}, "Settings") ); }
const getModel = (id) => { for (const model of Object.values(modelZoo).flat()) { if (id === model.modelId) { return model; } } return {}; }
// List all cached files/directories, at the top-level const list = async function({ cacheDir, cwd: cwdOpt, mode, depth = DEFAULT_DEPTH } = {}) { const bases = await getBases(cwdOpt) const cacheDirA = await getCacheDir({ cacheDir, mode }) const files = await Promise.all(bases.map(({ name, base }) => listBase({ name, base, cacheDir: cacheDirA, depth }))) const filesA = files.flat() return filesA }
/** * Removes a list of classes from the target element. * @param {Element} element - Element to edit classes of * @param {...string} classes - Names of classes to remove * @returns {Element} - `element` to allow for chaining */ static removeClass(element, ...classes) { for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(" "); classes = classes.flat().filter(c => c); element.classList.remove(...classes); return element; }
/** * Adds a list of classes from the target element. * @param {Element} element - Element to edit classes of * @param {...string} classes - Names of classes to add * @returns {Element} - `element` to allow for chaining */ static addClass(element, ...classes) { classes = classes.flat().filter(c => c); for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(" "); classes = classes.flat().filter(c => c); element.classList.add(...classes); return element; }
const publishNotifications = async (...promises) => { const notifications = await Promise.all(promises) notifications .flat() .forEach((notificationAdded) => pubsub.publish(NOTIFICATION_ADDED, { notificationAdded })) }
function getActivityColumns(Sequelize) { return ACTIVITIES.map(activity => [ { name: getRankKey(activity), type: Sequelize.INTEGER }, { name: getValueKey(activity), type: Sequelize.INTEGER } ]).flat(); }
function getBonuses(metas: SkillMeta[], type: BonusType): Bonus[] { return metas .filter(r => r.bonuses.length > 0) .map(r => r.bonuses) .flat() .filter(b => b?.end === (type === BonusType.End)); }
/** * Removes a list of classes from the target element. * @param {Element} element - Element to edit classes of * @param {...string} classes - Names of classes to remove * @returns {Element} - `element` to allow for chaining */ static removeClass(element, ...classes) { for (let c = 0; c < classes.length; c++) classes[c] = classes[c].toString().split(" "); classes = classes.flat().filter(c => c); element.classList.remove(...classes); return element; }
get footer() { const links = this.links; return (links.length || this.hasSettings) && BDV2.react.createElement("div", {className: "bd-card-footer bda-footer"}, BDV2.react.createElement("span", {className: "bd-addon-links bda-links"}, ...(links.map((element, index) => index < links.length - 1 ? [element, " | "] : element).flat()) ), this.hasSettings && BDV2.react.createElement("button", {onClick: this.showSettings, className: "bd-button bda-settings-button", disabled: !this.state.checked}, "Settings") ); }
function getActivityColumns(Sequelize) { return ACTIVITIES.map(activity => [ { name: getRankKey(activity), type: Sequelize.INTEGER }, { name: getValueKey(activity), type: Sequelize.INTEGER } ]).flat(); }
// List all cached files/directories, at the top-level const list = async function({ cacheDir, cwd: cwdOpt, mode, depth = DEFAULT_DEPTH } = {}) { const bases = await getBases(cwdOpt) const cacheDirA = await getCacheDir({ cacheDir, mode }) const files = await Promise.all(bases.map(({ name, base }) => listBase({ name, base, cacheDir: cacheDirA, depth }))) const filesA = files.flat() return filesA }
function getBossColumns(Sequelize) { return BOSSES.map(boss => [ { name: getRankKey(boss), type: Sequelize.INTEGER }, { name: getValueKey(boss), type: Sequelize.INTEGER } ]).flat(); }