Skip to content

Commit 1ab7d6e

Browse files
committed
Add support for null in API input types
1 parent 48ea074 commit 1ab7d6e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@
1717
*
1818
* @typedef Schema
1919
* Sanitization configuration.
20-
* @property {Attributes | undefined} [attributes]
20+
* @property {Attributes | null | undefined} [attributes]
2121
* Map of tag names to allowed properties.
2222
*
2323
* 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]
2525
* 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]
2727
* List of allowed tag names.
28-
* @property {Record<string, Array<string>> | undefined} [protocols]
28+
* @property {Record<string, Array<string>> | null | undefined} [protocols]
2929
* 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]
3131
* Map of tag names to their required ancestor elements.
32-
* @property {Array<string> | undefined} [clobber]
32+
* @property {Array<string> | null | undefined} [clobber]
3333
* List of allowed property names which can clobber.
34-
* @property {string | undefined} [clobberPrefix]
34+
* @property {string | null | undefined} [clobberPrefix]
3535
* Prefix to use before potentially clobbering property names.
36-
* @property {Array<string> | undefined} [strip]
36+
* @property {Array<string> | null | undefined} [strip]
3737
* Names of elements to strip from the tree.
38-
* @property {boolean | undefined} [allowComments]
38+
* @property {boolean | null | undefined} [allowComments]
3939
* Whether to allow comments.
40-
* @property {boolean | undefined} [allowDoctypes]
40+
* @property {boolean | null | undefined} [allowDoctypes]
4141
* Whether to allow doctypes.
4242
*
4343
* @typedef {(schema: Schema, value: any, node: any, stack: Array<string>) => unknown} Handler
@@ -69,7 +69,7 @@ const nodeSchema = {
6969
*
7070
* @param {Node} node
7171
* Hast tree to sanitize
72-
* @param {Schema} [schema]
72+
* @param {Schema | null | undefined} [schema]
7373
* Schema defining how to sanitize - defaults to Github style sanitation
7474
*/
7575
export function sanitize(node, schema) {

0 commit comments

Comments
 (0)