UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

19 lines 482 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.escapeHTML = escapeHTML; /** * Escapes HTML special characters in a string. * * @param str - The string to escape * @returns The escaped string */ function escapeHTML(str) { return str?.replace(/[&<>"']/g, (tag) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;', }[tag] ?? tag)); } //# sourceMappingURL=doc-escape.js.map