refactor(loldle): consume loldle.net's raw schema directly

Drop the in-scraper normalization step — champions.json now mirrors the
exact shape emitted by loldle.net's JS bundle. Records use _id,
championId, championName, arrays for positions/species/regions/
range_type, "Male"/"Female"/"Other" gender strings, and a full
YYYY-MM-DD release_date.

Comparison is schema-aware: multi-value keys accept arrays directly,
the year axis parses YYYY out of the ISO date, and exact compares stay
case-insensitive.
This commit is contained in:
2026-04-22 13:29:55 +07:00
parent 615dc8174c
commit df46e4ee22
10 changed files with 3193 additions and 1509 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ const sampleResults = [
{ key: "region", label: "Region", result: "correct", guessValue: "Runeterra" },
{ key: "lane", label: "Lane", result: "partial", guessValue: "Jungle, Support" },
{
key: "releaseDate",
key: "release_date",
label: "Year",
result: "wrong",
direction: "up",
@@ -48,7 +48,7 @@ describe("renderGuess", () => {
expect(up).toContain("2011 ⬆️");
const correctYear = sampleResults.map((r) =>
r.key === "releaseDate" ? { ...r, result: "correct", direction: undefined } : r,
r.key === "release_date" ? { ...r, result: "correct", direction: undefined } : r,
);
const out = renderGuess("Brand", correctYear);
expect(out).not.toContain("⬆️");