Skip to main content

sanitizeInput

@webda/core


Function: sanitizeInput()

sanitizeInput<T>(value, options?): Promise<T>

Defined in: packages/core/src/contexts/sanitize.ts:463

Sanitize every string of a parsed JSON value: every tag is removed and entities are escaped, unless the options say otherwise

The value is not modified: a sanitized copy is returned, without the __proto__, constructor and prototype keys.

Type Parameters​

T​

T = any

Parameters​

value​

T

the parsed JSON value

options?​

SanitizeInputOptions = {}

sanitize-html options replacing the defaults, and the paths sanitized another way

Returns​

Promise<T>

the sanitized value