79742640

Date: 2025-08-21 18:05:01
Score: 0.5
Natty:
Report link

I would handle it in that same line with null coalescing. I wouldn't map all undefined or null to [] via middleware, as that can lead to problems down the line if you need to handle things differently.

return { items: findItemById(idParam) ?? [] }
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: zshift