From b49ef3f705812e16f9f29d5b3aa5bdb3fe9968cd Mon Sep 17 00:00:00 2001 From: Ray Arayilakath Date: Sun, 2 May 2021 08:22:41 -0500 Subject: [PATCH] fix: iterate through repository language nodes Just made a little oopsie I forgot to actually count the language after getting more. Iterating (`.forEach(...)`) through each repository's language nodes should fix the problem. --- src/github_api_client.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/github_api_client.ts b/src/github_api_client.ts index f0a129d..50f94f9 100644 --- a/src/github_api_client.ts +++ b/src/github_api_client.ts @@ -85,8 +85,12 @@ export class GithubAPIClient { const languages = new Set(); userData.repositories.nodes.forEach((node: Repository) => { - if (node.languages.nodes[0] != undefined) { - languages.add(node.languages.nodes[0].name); + if (node.languages.nodes != undefined) { + node.languages.nodes.forEach((node: Language) => { + if (node != undefined) { + languages.add(node.name); + } + }); } }); const durationTime = new Date().getTime() - @@ -108,7 +112,7 @@ export class GithubAPIClient { languages.size, durationYear, ancientAccount, - joined2020 + joined2020, ); return userInfo; }