MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / escapeHtml

Function escapeHtml

example/tests/gm_download_test.js:89–94  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

87 }
88
89 function escapeHtml(s) {
90 return String(s).replace(
91 /[&<>"']/g,
92 (m) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[m]
93 );
94 }
95
96 function fmtMs(ms) {
97 return ms < 1000 ? `${ms | 0}ms` : `${(ms / 1000).toFixed(2)}s`;

Callers 6

passFunction · 0.70
failFunction · 0.70
skipFunction · 0.70
runOneFunction · 0.70
runAutoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected