[object Object]

← back to Consulting Rentv Com

refine: titleCase preserves 2-char cardinal directions (NW/SE) per Cody gate

60415ef760862cdc4b2417c4e88ee53e9fb072da · 2026-08-06 17:11:57 -0700 · Steve

Files touched

Diff

commit 60415ef760862cdc4b2417c4e88ee53e9fb072da
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu Aug 6 17:11:57 2026 -0700

    refine: titleCase preserves 2-char cardinal directions (NW/SE) per Cody gate
---
 scripts/refresh-deals.mjs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/refresh-deals.mjs b/scripts/refresh-deals.mjs
index 303c08f..98cd999 100644
--- a/scripts/refresh-deals.mjs
+++ b/scripts/refresh-deals.mjs
@@ -21,7 +21,7 @@ const readJson = (p, fb) => { try { return JSON.parse(readFileSync(p, 'utf8'));
 const asArray = (v) => Array.isArray(v) ? v : (v && (v.deals || v.ranked || v.items || v.points || v.map || Object.values(v).find(Array.isArray))) || [];
 // Normalize ALL-CAPS vendor strings to Title Case (keep short tokens like directionals uppercased where sane).
 const titleCase = (s) => typeof s === 'string'
-  ? s.replace(/\w\S*/g, w => w.length <= 2 && /^[NSEW]$/i.test(w) ? w.toUpperCase() : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
+  ? s.replace(/\w\S*/g, w => w.length <= 2 && /^[NSEW]{1,2}$/i.test(w) ? w.toUpperCase() : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
   : s;
 // LA-metro bounds — keep the map tight (drops Antelope Valley / far-outlier pins).
 const inLA = (lat, lng) => lat >= 33.5 && lat <= 34.5 && lng >= -119 && lng <= -117.5;

← e823c6a refine growth page (agent audit): correctness + data hygiene  ·  back to Consulting Rentv Com  ·  chore: v0.4.0 (session close — CRCP deal refresh + refresh-d 55f002c →