|
17 | 17 | *
|
18 | 18 | * @typedef Schema
|
19 | 19 | * Sanitization configuration.
|
20 |
| - * @property {Attributes | undefined} [attributes] |
| 20 | + * @property {Attributes | null | undefined} [attributes] |
21 | 21 | * Map of tag names to allowed properties.
|
22 | 22 | *
|
23 | 23 | * The special `'*'` key defines property names allowed on all elements.
|
24 |
| - * @property {Record<string, Record<string, PropertyValue>> | undefined} [required] |
| 24 | + * @property {Record<string, Record<string, PropertyValue>> | null | undefined} [required] |
25 | 25 | * Map of tag names to required property names and their default property value.
|
26 |
| - * @property {Array<string> | undefined} [tagNames] |
| 26 | + * @property {Array<string> | null | undefined} [tagNames] |
27 | 27 | * List of allowed tag names.
|
28 |
| - * @property {Record<string, Array<string>> | undefined} [protocols] |
| 28 | + * @property {Record<string, Array<string>> | null | undefined} [protocols] |
29 | 29 | * Map of protocols to allow in property values.
|
30 |
| - * @property {Record<string, Array<string>> | undefined} [ancestors] |
| 30 | + * @property {Record<string, Array<string>> | null | undefined} [ancestors] |
31 | 31 | * Map of tag names to their required ancestor elements.
|
32 |
| - * @property {Array<string> | undefined} [clobber] |
| 32 | + * @property {Array<string> | null | undefined} [clobber] |
33 | 33 | * List of allowed property names which can clobber.
|
34 |
| - * @property {string | undefined} [clobberPrefix] |
| 34 | + * @property {string | null | undefined} [clobberPrefix] |
35 | 35 | * Prefix to use before potentially clobbering property names.
|
36 |
| - * @property {Array<string> | undefined} [strip] |
| 36 | + * @property {Array<string> | null | undefined} [strip] |
37 | 37 | * Names of elements to strip from the tree.
|
38 |
| - * @property {boolean | undefined} [allowComments] |
| 38 | + * @property {boolean | null | undefined} [allowComments] |
39 | 39 | * Whether to allow comments.
|
40 |
| - * @property {boolean | undefined} [allowDoctypes] |
| 40 | + * @property {boolean | null | undefined} [allowDoctypes] |
41 | 41 | * Whether to allow doctypes.
|
42 | 42 | *
|
43 | 43 | * @typedef {(schema: Schema, value: any, node: any, stack: Array<string>) => unknown} Handler
|
@@ -69,7 +69,7 @@ const nodeSchema = {
|
69 | 69 | *
|
70 | 70 | * @param {Node} node
|
71 | 71 | * Hast tree to sanitize
|
72 |
| - * @param {Schema} [schema] |
| 72 | + * @param {Schema | null | undefined} [schema] |
73 | 73 | * Schema defining how to sanitize - defaults to Github style sanitation
|
74 | 74 | */
|
75 | 75 | export function sanitize(node, schema) {
|
|
0 commit comments