Module json

Functions

to_json (value) ⚠️.
from_json (text[, schema[, constructors]]) ⚠️.


Functions

to_json (value)
⚠️. This function gets the value data with the data.to_data() function. Then the function transforms this data into the JSON.

Parameters:

  • value any

Returns:

    string

Or

  1. nil
  2. string error message
from_json (text[, schema[, constructors]])
⚠️. This function transforms the text in the JSON to a data.

Parameters:

  • text string
  • schema tab JSON Schema (optional)
  • constructors {[string]=func,...} constructors for tables with the __name property; the values should be func(options: tab): tab; the constructor can either return an error as the second result or throw it as an exception (optional)

Returns:

    any

Or

  1. nil
  2. string error message
generated by LDoc 1.5.0 Last updated 2025-01-12 02:30:45