Skip to content

Commit

Permalink
fix: prevent undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Jan 9, 2024
1 parent f9e28d8 commit e8b4e96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
<% Object.entries(it.data).forEach(function([name]) { %>
<div class="py-1">
<a href="<%= name %>">/<%= name %></a>
<span class="text-gray-500">- <%= it.data[name].length %></span>
<span class="text-gray-500">
<% if (Array.isArray(it.data[name])) { %>
- <%= it.data[name].length %> items</span>
<% } %>
</div>
<% }) %>
</main>
Expand Down

0 comments on commit e8b4e96

Please sign in to comment.