[object Object]

← back to Ventura Claw Leads

Tighten falsy-zero check in neighborhood.ejs total display

a8cee0a48d372e08ca047dd2dd0a10f484d69e72 · 2026-05-07 13:12:49 -0700 · Steve Abrams

Use 'typeof !== undefined' instead of truthiness so a legit 0
doesn't fall back to businesses.length. Cosmetic — both equal 0
for empty neighborhoods so no user-visible change. Caught by
codex-3way PROSECUTOR sweep on HEAD~5..HEAD.

Files touched

Diff

commit a8cee0a48d372e08ca047dd2dd0a10f484d69e72
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu May 7 13:12:49 2026 -0700

    Tighten falsy-zero check in neighborhood.ejs total display
    
    Use 'typeof !== undefined' instead of truthiness so a legit 0
    doesn't fall back to businesses.length. Cosmetic — both equal 0
    for empty neighborhoods so no user-visible change. Caught by
    codex-3way PROSECUTOR sweep on HEAD~5..HEAD.
---
 views/public/neighborhood.ejs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/views/public/neighborhood.ejs b/views/public/neighborhood.ejs
index 1f76f2e..97c0f54 100644
--- a/views/public/neighborhood.ejs
+++ b/views/public/neighborhood.ejs
@@ -47,7 +47,11 @@
   <p class="kicker">On Ventura Blvd</p>
   <h1 class="display-sm">Businesses in <%= neighborhood.label %></h1>
   <%
-    var _displayTotal = (typeof totalCount !== 'undefined' && totalCount) ? totalCount : businesses.length;
+    // Use !== undefined (not truthiness) so a legitimate 0 doesn't fall
+    // back to businesses.length. PROSECUTOR caught the falsy-zero edge in
+    // the codex-3way sweep; harmless in practice (both equal 0 for empty
+    // neighborhoods) but cleaner this way.
+    var _displayTotal = (typeof totalCount !== 'undefined') ? totalCount : businesses.length;
   %>
   <p class="lede"><%= _displayTotal %> business<%= _displayTotal === 1 ? '' : 'es' %> in <%= neighborhood.label %>. Search by name, browse by category, or jump straight to a profile and send a message.</p>
 

← 199f582 Fix 3 bugs in backfill-corridor-geo.js caught by codex-3way  ·  back to Ventura Claw Leads  ·  Inject neighborhood into seeded headlines (170 distinct phra 5a49679 →