Function: toJSON()
ts
function toJSON(
target: unknown,
separator?: string,
depth?: number,
maxDepth?: number,
circular?: LuaTable<AnyNotNil, boolean>): string;JSON.stringify alternative for lua data types.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
target | unknown | undefined | Value to stringify as json. |
separator | string | " " | Separator of each key-value pair after comma. |
depth | number | 0 | Current depth of json transformation. |
maxDepth | number | 7 | Maximal depth to transform, replace with <depth_limit> otherwise. |
circular | LuaTable<AnyNotNil, boolean> | ... | Registry of circular items references, return <depth_limit> in case of circular references. |
Returns
string
Stringified to json value.