Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2026-01-16 16:21:59 +03:00
parent 23b5c41fa0
commit bd17b1df38

View File

@ -8,8 +8,9 @@ This extends the default JSON serialization adding the following:
- Deep and partial-deep cleen object copy - Deep and partial-deep cleen object copy
Possible differences to JSON output: Possible differences to JSON output:
- Repeating long strings and BigInts can be referenced instead of - Repeating long strings and BigInts are referenced by default instead of
reincluded in the output. being reincluded in the output.
## Motivation ## Motivation
@ -67,6 +68,27 @@ serialize(obj, indent, depth=0, options){
-> <string> -> <string>
``` ```
Options format:
```
{
// pretty-printing indent...
// (default: undefined)
indent: undefined,
// outout root indent...
// (default: 0)
depth: 0,
// minimal referenced string/bigint length...
// (default: MIN_LENGTH_REF)
min_length_ref: MIN_LENGTH_REF,
// functions list...
// (default: undefined)
functions: undefined,
}
```
Supported options: Supported options:
- `indent` controls formatting and nested value indent, if set to a number - `indent` controls formatting and nested value indent, if set to a number
that number of spaces will be used to indent nested values if given a that number of spaces will be used to indent nested values if given a