import Debug from "debug"; import * as cache from "./cache"; import { mkdirSync, writeFileSync } from "fs"; import { Calendar, Event, Sport, Team } from "./types"; import { generateICSFiles } from "./ics"; const baseUrl = "https://www.olympics.com"; const basePath = "/milano-cortina-2026/schedule/overview"; const debug = Debug(`olympics-calendar:index`); const getScheduleOverview = async (language: string) => { debug(`getScheduleOverview: language=${language}`); const scheduleOverviewKey = `${language}/schedule-overview`; if (!cache.has(scheduleOverviewKey)) { debug(`Fetching ${baseUrl}/${language}${basePath}`); const response = await fetch(`${baseUrl}/${language}/${basePath}`); const page = await response.text(); const dataMatch = page.match(/