Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

Refine escapeHtml null handling (#5810)

authored by yoginth.com and committed by

GitHub 8495ce70 7bc0a141

+5 -1
+5 -1
packages/helpers/escapeHtml.ts
··· 1 1 const escapeHtml = (str?: string | null): string => { 2 - return String(str ?? "") 2 + if (str == null) { 3 + return ""; 4 + } 5 + 6 + return String(str) 3 7 .replace(/&/g, "&amp;") 4 8 .replace(/</g, "&lt;") 5 9 .replace(/>/g, "&gt;")