simulator-inputs: move dynamic import to top level so heavy module
initialization happens during file load (no timeout) instead of inside
the test body.
llws-simulator: make iteration count injectable via constructor
(default 50_000 for production, tests pass 1_000). Cuts test suite
from ~4s per test to <150ms for all 21 tests combined.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch MLB standings from deprecated statsapi.mlb.com to ESPN API
(same source as NBA, WNBA, MLS — no auth required)
- Extract shared espn.ts utility: EspnStat/Team/Entry/Group/Response
interfaces, statsMap(), flattenEspnStandings(), parseConferenceRank(),
sortByWinLoss(); removes 4× duplication across adapters
- Fix parseConferenceRank falsy-zero bug (|| undefined → isNaN guard)
- Add stable alphabetical tiebreaker to MLB, NBA, WNBA sort comparators
- Fix winPct silent-zero: fall back to wins/(wins+losses) if ESPN omits stat
- Pre-build statsMap once per entry before sorting in all adapters
- Fix WNBA parseEntry to accept pre-computed sm instead of rebuilding it
- Restore and update gamesBack tests (ESPN returns numeric 0 for leaders,
not the old API's "-" string)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>