(unsafe: string)
| 482 | * Source: https://stackoverflow.com/a/6234804/3015595 |
| 483 | **/ |
| 484 | export function escapeHtml(unsafe: string): string { |
| 485 | return unsafe |
| 486 | .replace(/&/g, "&") |
| 487 | .replace(/</g, "<") |
| 488 | .replace(/>/g, ">") |
| 489 | .replace(/"/g, """) |
| 490 | .replace(/'/g, "'") |
| 491 | } |
| 492 | |
| 493 | /** |
| 494 | * A helper function which returns a boolean indicating whether |
no outgoing calls
no test coverage detected