mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 00:26:26 +00:00
The filter derefed item.text.toLowerCase() from a cast API response on the same line that already guards g.items ?? [], so one item with a null or missing text threw TypeError and the whole command exited 1 as API_ERROR. The filter is extracted into an exported filterAutocompleteGroups (the jobnet testability pattern), text is typed nullable so the compiler enforces the guard, and an item without usable text is skipped: it can never match the required non-empty query, so downstream output never sees one. The null-text case was verified to fail against the verbatim unguarded extraction with the production TypeError. Closes out the #416/#418 audit.