/**
 * Escapes a value for safe HTML output.
 *
 * @param {string|number|null|undefined} value
 *   The raw value.
 *
 * @return {string}
 *   The escaped value.
 */
export default function escapeHtml(value) {
  return String(value ?? "")
    .replace(/&/g, "&amp;")
    .replace(/</g, "&lt;")
    .replace(/>/g, "&gt;")
    .replace(/"/g, "&quot;")
    .replace(/'/g, "&#039;");
}
