json. isObject Synchronous
Check whether the JSON library classifies a value as an object. Use it to check that parsed input is an object before reading named settings. It recognizes marked objects and tables that are not classified as arrays.
Luau
json.isObject(value: any) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to inspect without encoding it. |
Returns
booleantrue if the value is classified as an object; otherwise false.
Example
Luau
local value = json.decode('{"theme":"dark"}')
if json.isObject(value) then
print(value.theme)
end
print(json.isObject(json.array())) -- false