diff --git a/cli.ts b/cli.ts index 163d1ce..70f91de 100644 --- a/cli.ts +++ b/cli.ts @@ -34,7 +34,9 @@ for (const row of dom.querySelectorAll("tr")) { .filter((n) => n.nodeName === "TD") .map((n) => n.textContent.trim()); // Skip invalid entries - if (!institution || !location || !entry || !code || entry === "Names TBA") continue; + if (!institution || !location || !entry || !code || entry === "Names TBA") { + continue; + } entries.push({ institution, @@ -104,7 +106,12 @@ const nsdaSearchResults = await Promise schoolFilterUsed = true; nsdaLookup = nsdaLookup.filter((ee) => - ee.school_name.toLowerCase().includes(e.institution.toLowerCase()) + ee.school_name.replace(/[^a-zA-Z0-9 -]/g, "").toLowerCase().includes( + e.institution.replace(/[^a-zA-Z0-9 -]/g, "").toLowerCase(), + ) || + e.institution.replace(/[^a-zA-Z0-9 -]/g, "").toLowerCase().includes( + ee.school_name.replace(/[^a-zA-Z0-9 -]/g, "").toLowerCase(), + ) ); } diff --git a/constants.ts b/constants.ts index de6ceb5..b057a07 100644 --- a/constants.ts +++ b/constants.ts @@ -6,4 +6,4 @@ export const overrides: Record< name: "Christopher Chavez", id: 10847338, }, -}; \ No newline at end of file +};