json.isObject Synchronous

Check whether a table will be treated as a JSON object rather than an array. This is a quick shape check before reading named settings from decoded input.

Syntax
Luau
json.isObject(value: any) -> boolean

Parameters

Function parameters
ParameterTypeDescription
valueanyValue to inspect.

Returns

boolean

true for a table that json.isArray does not classify as an array; false for other value types.

Usage notes

A plain empty table is an object by default. Mark an empty list with json.array when that distinction matters.

Example

Example
Luau
local parsed = json.decode('{"theme":"dark"}')
if json.isObject(parsed) then
    print(parsed.theme)
end
Kawaii documentation