sc-idp/lib/web.js
2026-06-01 16:40:54 -05:00

16 lines
383 B
JavaScript

// Small shared web helpers for the plugin's HTML responses.
const escapeHtml = (value) => {
const s = value === null || value === undefined ? "" : String(value);
return s
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;");
};
module.exports = {
escapeHtml
};