export const escapeHTML = (str: string): string => { const entityMap: { [key: string]: string } = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '/': '/', }; return String(str).replace(/[&<>"'/]/g, function(s) { return entityMap[s]; }); };