@@ -5,30 +5,50 @@ import type { ContextOf, SplitUndefined } from "./context";
55export type EncodeOptions < ContextType = undefined > = Partial <
66 Readonly < {
77 extensionCodec : ExtensionCodecType < ContextType > ;
8+
9+ /**
10+ * The maximum depth in nested objects and arrays.
11+ *
12+ * Defaults to 100.
13+ */
814 maxDepth : number ;
15+
16+ /**
17+ * The initial size of the internal buffer.
18+ *
19+ * Defaults to 2048.
20+ */
921 initialBufferSize : number ;
10- sortKeys : boolean ;
1122
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 ;
1230 /**
1331 * If `true`, non-integer numbers are encoded in float32, not in float64 (the default).
1432 *
1533 * Only use it if precisions don't matter.
34+ *
35+ * Defaults to `false`.
1636 */
1737 forceFloat32 : boolean ;
1838
1939 /**
2040 * If `true`, an object property with `undefined` value are ignored.
2141 * e.g. `{ foo: undefined }` will be encoded as `{}`, as `JSON.stringify()` does.
2242 *
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 .
2444 */
2545 ignoreUndefined : boolean ;
2646
2747 /**
28- * If `true`, integer numbers are encoded as floating point,
48+ * If `true`, integer numbers are encoded as floating point numbers ,
2949 * with the `forceFloat32` option taken into account.
3050 *
31- * The default is `false`.
51+ * Defaults to `false`.
3252 */
3353 forceIntegerToFloat : boolean ;
3454 } >
0 commit comments