4
4
*/
5
5
6
6
/**
7
- * @typedef {Literal & {type: 'raw'} } Raw
8
- * To do: improved `Raw` type?
9
- *
10
- * @typedef {'"' | "'" } Quote
11
- * XML quotes for attribute values.
12
- *
13
7
* @typedef Options
14
8
* Configuration.
15
9
* @property {boolean | null | undefined } [allowDangerousXml=false]
16
- * Allow `raw` nodes and insert them as raw XML.
10
+ * Allow `raw` nodes and insert them as raw XML (default: `false`) .
17
11
*
18
12
* When `false`, `Raw` nodes are encoded.
19
13
*
20
14
* > ⚠️ **Danger**: only set this if you completely trust the content.
21
15
* @property {boolean | null | undefined } [closeEmptyElements=false]
22
16
* Close elements without any content with slash (`/`) on the opening tag
23
- * instead of an end tag: `<circle />` instead of `<circle></circle>`.
17
+ * instead of an end tag: `<circle />` instead of `<circle></circle>`
18
+ * (default: `false`).
24
19
*
25
20
* See `tightClose` to control whether a space is used before the slash.
26
21
* @property {Quote | null | undefined } [quote='"']
27
- * Preferred quote to use.
22
+ * Preferred quote to use (default: `'"'`) .
28
23
* @property {boolean | null | undefined } [quoteSmart=false]
29
- * Use the other quote if that results in less bytes.
24
+ * Use the other quote if that results in less bytes (default: `false`) .
30
25
* @property {boolean | null | undefined } [tightClose=false]
31
26
* Do not use an extra space when closing self-closing elements: `<circle/>`
32
- * instead of `<circle />`.
27
+ * instead of `<circle />` (default: `false`) .
33
28
*
34
29
* > 👉 **Note**: only used if `closeEmptyElements: true`.
35
30
*
31
+ * @typedef {'"' | "'" } Quote
32
+ * XML quotes for attribute values.
33
+ *
34
+ * @typedef {Literal & {type: 'raw'} } Raw
35
+ * To do: improved `Raw` type?
36
+ *
37
+ *
36
38
* @typedef State
37
39
* Info passed around about the current state.
38
40
* @property {Options } options
@@ -47,7 +49,7 @@ import {one} from './one.js'
47
49
* @param {Array<Nodes> | Nodes } tree
48
50
* xast node(s) to serialize.
49
51
* @param {Options | null | undefined } [options]
50
- * Configuration.
52
+ * Configuration (optional) .
51
53
* @returns {string }
52
54
* Serialized XML.
53
55
*/
0 commit comments