Private
Readonly
_entityPrivate
_extendExtends an object of arrays by by concatenating arrays of the same object keys. If the if the previous key's value is not an array, the next key's value will replace the previous key. This method is used for extending the whiteList in the XSS filter options.
An array of objects.
The extended object.
Sanitizer
Private
_iterateIterate over a plain object or array to deeply sanitize each value.
The object to iterate over.
The sanitized object.
Sanitizer
Private
_trimTrim whitespace from the start and ends of a string.
The string to trim.
The trimmed string.
Private
_xssReadonly
allowedReadonly
arcgisCSSWhiteReadonly
arcgisReadonly
arcgisReadonly
xssSanitizes value to remove invalid HTML tags.
Note: If the value passed does not contain a valid JSON data type (String, Number, JSON Object, Array, Boolean, or null), the value will be nullified.
The value to sanitize.
Optional
options: ISanitizeOptionsThe sanitized value.
Sanitizer
Sanitizes an HTML attribute value.
The tagname of the HTML element.
The attribute name of the HTML element.
The raw value to be used for the HTML attribute value.
Optional
cssFilter: ICSSFilterThe CSS filter to be used.
The sanitized attribute value.
Sanitizer
Sanitizes a URL string following the allowed protocols and sanitization rules.
The URL to sanitize.
Optional
options: { Configuration options for URL checking.
Optional
isWhether a protocol must exist on the URL for it to be considered valid. Defaults to true
. If false
and the provided URL has no protocol, it will be automatically prefixed with https://
.
The sanitized URL if it's valid, or an empty string if the URL is invalid.
The Sanitizer Class
Export
Sanitizer