Module jsonutils
Functions
save_to_json (path, value) | |
load_from_json (path, schema[, constructors]) |
Functions
- save_to_json (path, value)
-
Parameters:
- path string
- value any
Returns:
-
bool
Or
- nil
- string error message
- load_from_json (path, schema[, constructors])
-
Parameters:
- path string
- schema tab JSON Schema
- constructors
{[string]=func,...}
constructors for tables with the
__name
property; the values should befunc(options: tab): tab
; the constructor can either return an error as the second result or throw it as an exception (optional)
Returns:
-
any
Or
- nil
- string error message