Skip to main content

Đối số

string
bắt buộc
JSON string de parse. Function doc argument nay bang string type checking.
DecodeOptions
Optional decode options. boolean dat useNull. table co the dat useNull va maxDepth.

Giá trị trả về

boolean
true khi parsing thanh cong, false khi parsing that bai trong protected parse block.
any | nil
Decoded value khi success. Khi parse failure, return nay la nil.
string | nil
Error message khi parse failure. Message duoc prefixed bang json.decodeSafe va co near-position suffix.
number | nil
Parser byte position tu parser khi parse failure. Return nay chi co khi failure.

Kiểu

DecodeOptions

Kiểm soát hành vi phân tích cú pháp JSON.

Ví dụ

Decode JSON voi status returns bang json.decodeSafe-compatible alias.