Session 7d: Audit fixes - rate limiting, error leak, parallel parlays, analyze cache, bundle analyzer

This commit is contained in:
Kev
2026-06-10 03:12:20 -04:00
parent d954e4d952
commit 6f4a353de9
18 changed files with 913 additions and 72 deletions
+6 -1
View File
@@ -48,6 +48,11 @@ const espnSportPath = {
function sleep(ms) { return new Promise((r) => setTimeout(r, ms)); }
// DUP-1 (Session 7c): a near-twin lives in
// src/services/intelligence/trapDetection.js. This variant KEEPS digits
// because some legacy roster fields encode jersey numbers in the name
// string; the trap detector strips them. If those legacy fields ever
// go away, consolidate to a shared util in src/utils/.
function normalizeName(name) {
if (!name) return '';
return name
@@ -55,7 +60,7 @@ function normalizeName(name) {
.replace(/[̀-ͯ]/g, '') // strip accents
.toLowerCase()
.replace(/\b(jr|sr|ii|iii|iv|v)\.?\b/g, '') // suffixes
.replace(/[^a-z0-9\s]/g, ' ') // punctuation
.replace(/[^a-z0-9\s]/g, ' ') // punctuation (keeps digits)
.replace(/\s+/g, ' ') // collapse spaces
.trim();
}