From 3d622db8b01422f22f29cdfe9d014f80b6b4fcf0 Mon Sep 17 00:00:00 2001 From: Alien Deployer Date: Sun, 20 Oct 2024 16:13:19 +0300 Subject: [PATCH] calculate contests with images in `overview.ts`, show in `overview-full.ts` --- tools/overview-full.ts | 2 +- tools/overview.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/overview-full.ts b/tools/overview-full.ts index dd5abcb..f5bdcf0 100644 --- a/tools/overview-full.ts +++ b/tools/overview-full.ts @@ -108,6 +108,6 @@ for (const contestId of Object.keys(contests).filter(c => !contests[c].hidden)) const startDateArr = new Date(contest.start * 1000).toUTCString().split(' ') const endDateArr = new Date(contest.end * 1000).toUTCString().split(' ') const dates = `${startDateArr[1]} ${startDateArr[2]} ${startDateArr[3]} - ${endDateArr[1]} ${endDateArr[2]} ${endDateArr[3]}` - console.log(`[${contestId}] ${contest.name}. ${dates}. Rewards: ${contest.rewards.map(r => r.type).join(', ')}.`) + console.log(`[${contestId}] ${contest.name}. ${dates}. Rewards: ${Array.isArray(contest.rewards) ? contest.rewards.map(r => r.type).join(', ') : contest.rewards}.${!!contest.img ? ` Image: ${contest.img}.` : ''}`) } console.log('') diff --git a/tools/overview.ts b/tools/overview.ts index e3ba673..382843c 100644 --- a/tools/overview.ts +++ b/tools/overview.ts @@ -32,5 +32,5 @@ console.log(`Chains: ${Object.keys(chains).length}. ChainLib: ${networkTotal.AWA console.log(`DeFi organizations: ${Object.keys(integrations).length}. Protocols: ${protocolsTotal}.`) console.log(`Assets: ${assets.length}. Tokenlist ${tokenlist.version.major}.${tokenlist.version.minor}.${tokenlist.version.patch}: ${tokenlist.tokens.length} tokens for ${tokenlist.tokens.map(t => t.chainId).filter((value, index, array) => array.indexOf(value) === index).length} chains.`) console.log(`Seed nodes: ${seeds.length}`) -console.log(`Contests: ${Object.keys(contests).filter(c => !contests[c].hidden).length}`) +console.log(`Contests: ${Object.keys(contests).filter(c => !contests[c].hidden).length}. Contests with images: ${Object.keys(contests).filter(c => !contests[c].hidden).filter(c => !!contests[c].img).length}.`) console.log(``)