mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 00:26:26 +00:00
date: job.publicationDate.slice(0, 10) trusted a TypeScript interface claim nothing validates at runtime: apiFetch casts the JSON body, so one ad with a null publication date threw TypeError inside the jobAds map and the whole search exited 1 as API_ERROR. The neighboring applicationDeadline field was already null-guarded with a 1900-01-01 sentinel. publicationDate is now typed nullable so the compiler enforces the guard, and the ad degrades per-item to date: null. New test verified to fail on the unfixed code with the exact production TypeError.