mirror of
https://github.com/Findus23/RainbowRoad.git
synced 2024-09-19 16:03:52 +02:00
18 lines
414 B
TypeScript
18 lines
414 B
TypeScript
import * as fs from "fs";
|
|
import type {Crossing} from "../interfaces";
|
|
|
|
function runstats() {
|
|
const data: Crossing[] = JSON.parse(fs.readFileSync("../data/Wien.json", 'utf8'));
|
|
|
|
|
|
const bezirke = data.map(c => c.bezirk!)
|
|
const counts: { [key: number]: number } = {};
|
|
|
|
for (const num of bezirke) {
|
|
counts[num] = counts[num] ? counts[num] + 1 : 1;
|
|
}
|
|
console.log(counts)
|
|
|
|
}
|
|
|
|
runstats()
|