Completed
Push — master ( 707bed...180ffd )
by Daniel
26s queued 12s
created

scripts/utils/escapeHtml.ts   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 11
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 9
mnd 0
bc 0
fnc 1
dl 0
loc 11
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
function escapeHtml(unsafe: string): string  {
2
  return unsafe
3
    .replaceAll("&", "&")
4
    .replaceAll("<", "&lt;")
5
    .replaceAll(">", "&gt;")
6
    .replaceAll('"', "&quot;")
7
    .replaceAll("'", "&#039;");
8
}
9
10
export default escapeHtml;
11