diff --git a/scripts/extractLayer.ts b/scripts/extractLayer.ts index 5fd0c4306..66f52ddb1 100644 --- a/scripts/extractLayer.ts +++ b/scripts/extractLayer.ts @@ -15,7 +15,7 @@ function main(args: string[]) { const layerId = args[1] const themePath = "./assets/themes/" + themeId + "/" + themeId + ".json" - const contents = JSON.parse(readFileSync(themePath, "UTF-8")) + const contents = JSON.parse(readFileSync(themePath, { encoding: "utf8" })) const layers = contents.layers.filter((l) => { if (typeof l === "string") { return false diff --git a/scripts/generateContributors.ts b/scripts/generateContributors.ts index 80643a3a6..6f526383a 100644 --- a/scripts/generateContributors.ts +++ b/scripts/generateContributors.ts @@ -1,10 +1,23 @@ import { exec } from "child_process" import { writeFile, writeFileSync } from "fs" -function asList(hist: Map): { - contributors: { contributor: string; commits: number }[] -} { - const ls = [] +interface Contributor { + /** + * The name of the contributor + */ + contributor: string + /** + * The number of commits + */ + commits: number +} + +interface ContributorList { + contributors: Contributor[] +} + +function asList(hist: Map): ContributorList { + const ls: Contributor[] = [] hist.forEach((commits, contributor) => { ls.push({ commits, contributor }) })