const ESCAPES: Record = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }; /** * Text → HTML text or a quoted attribute value. The one escaper for the * server, the web app, the extension and the mail templates: & < > " '. */ export const escapeHtml = (value: string) => value.replace(/[&<>"']/g, (char) => ESCAPES[char]!);