Class: HtmlEscaper

HtmlEscaper()

Provides utility for escaping HTML characters to prevent XSS.

Constructor

new HtmlEscaper()

Source:

Methods

escape(value) → {string}

Escapes special HTML characters in a string.

Parameters:
Name Type Description
value any

The value to escape.

Source:
Returns:

The escaped string.

Type
string

unescape(value) → {string}

Unescapes HTML entities in a string back to original characters.

Parameters:
Name Type Description
value any

The value to unescape.

Source:
Returns:

The unescaped string.

Type
string