Session 7d: Audit fixes - rate limiting, error leak, parallel parlays, analyze cache, bundle analyzer
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user