@@ -5,30 +5,50 @@ import type { ContextOf, SplitUndefined } from "./context";
5
5
export type EncodeOptions < ContextType = undefined > = Partial <
6
6
Readonly < {
7
7
extensionCodec : ExtensionCodecType < ContextType > ;
8
+
9
+ /**
10
+ * The maximum depth in nested objects and arrays.
11
+ *
12
+ * Defaults to 100.
13
+ */
8
14
maxDepth : number ;
15
+
16
+ /**
17
+ * The initial size of the internal buffer.
18
+ *
19
+ * Defaults to 2048.
20
+ */
9
21
initialBufferSize : number ;
10
- sortKeys : boolean ;
11
22
23
+ /**
24
+ * If `true`, the keys of an object is sorted. In other words, the encoded
25
+ * binary is canonical and thus comparable to another encoded binary.
26
+ *
27
+ * Defaults to `false`. If enabled, it spends more time in encoding objects.
28
+ */
29
+ sortKeys : boolean ;
12
30
/**
13
31
* If `true`, non-integer numbers are encoded in float32, not in float64 (the default).
14
32
*
15
33
* Only use it if precisions don't matter.
34
+ *
35
+ * Defaults to `false`.
16
36
*/
17
37
forceFloat32 : boolean ;
18
38
19
39
/**
20
40
* If `true`, an object property with `undefined` value are ignored.
21
41
* e.g. `{ foo: undefined }` will be encoded as `{}`, as `JSON.stringify()` does.
22
42
*
23
- * The default is `false`. Note that it needs more time to encode .
43
+ * Defaults to `false`. If enabled, it spends more time in encoding objects .
24
44
*/
25
45
ignoreUndefined : boolean ;
26
46
27
47
/**
28
- * If `true`, integer numbers are encoded as floating point,
48
+ * If `true`, integer numbers are encoded as floating point numbers ,
29
49
* with the `forceFloat32` option taken into account.
30
50
*
31
- * The default is `false`.
51
+ * Defaults to `false`.
32
52
*/
33
53
forceIntegerToFloat : boolean ;
34
54
} >
0 commit comments