Skip to main content

getSanitizeModes

@webda/core


Function: getSanitizeModes()

getSanitizeModes(schema, root?): SanitizeModes

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

The sanitization modes an input schema declares (x-webda-sanitize), per dotted path

The keyword only counts on a string, an array of strings or a record of strings: on any other schema it is ignored, so an object or a free-form value is always sanitized as text. Nested properties, array items (items.*.label) and record values are followed, as are local $refs. text and unknown modes are the default: they are not listed.

Parameters​

schema​

any

the input schema

root?​

any = schema

the schema carrying the definitions

Returns​

SanitizeModes

the modes per path, * standing for any array index or record key