Skip to main content

json

Description:

  JSON library for Dora.

load

Type: Function.

Description:

  Parses the specified JSON text and returns the corresponding table.

Signature:

load: function(json: string, maxDepth?: integer): table | nil

Parameters:

ParameterTypeDescription
jsonstringThe JSON text to parse.
maxDepthnumber[optional] The maximum depth of parsing (default is 128).

Returns:

Return TypeDescription
tableThe table representing the JSON data, or nil if the text is not valid JSON.

dump

Type: Function.

Description:

  Dumps the specified table into a JSON text.

Signature:

dump: function(tab: table): string | nil

Parameters:

ParameterTypeDescription
tabtableThe table to dump.

Returns:

Return TypeDescription
stringThe JSON text representing the table, or nil if the table cannot be dumped.

null

Type: Field.

Description:

  Represents a JSON null value.

Signature:

null: JsonNull