Skip to main content

JSONUtils

Utility methods for JSON

Functions

jsonDecode

JSONUtils.jsonDecode(strstring) → (
boolean,
table?,--

Result

string?--

Error

)

Decodes JSON, or reports error.

jsonEncode

JSONUtils.jsonEncode(valueany) → (
boolean,
table?,--

Result

string?--

Error

)

Encodes JSON, or reports error.

promiseJSONDecode

JSONUtils.promiseJSONDecode(strstring) → Promise<table>

Decodes JSON, or reports error.

Show raw api
{
    "functions": [
        {
            "name": "jsonDecode",
            "desc": "Decodes JSON, or reports error.",
            "params": [
                {
                    "name": "str",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "desc": "Result",
                    "lua_type": "table?"
                },
                {
                    "desc": "Error",
                    "lua_type": "string?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 21,
                "path": "src/jsonutils/src/Shared/JSONUtils.lua"
            }
        },
        {
            "name": "jsonEncode",
            "desc": "Encodes JSON, or reports error.",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "desc": "Result",
                    "lua_type": "table?"
                },
                {
                    "desc": "Error",
                    "lua_type": "string?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 44,
                "path": "src/jsonutils/src/Shared/JSONUtils.lua"
            }
        },
        {
            "name": "promiseJSONDecode",
            "desc": "Decodes JSON, or reports error.",
            "params": [
                {
                    "name": "str",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<table>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 61,
                "path": "src/jsonutils/src/Shared/JSONUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "JSONUtils",
    "desc": "Utility methods for JSON",
    "source": {
        "line": 5,
        "path": "src/jsonutils/src/Shared/JSONUtils.lua"
    }
}