Skip to main content

引数

string
必須
Parse する JSON string。function はこの argument を string type checking で読みます。
DecodeOptions
Optional decode options。boolean は useNull を設定します。table は useNull と maxDepth を設定できます。

戻り値

boolean
Parsing が成功した場合 true、protected parse block 内で parsing が失敗した場合 false。
any | nil
Success 時の decoded value。Parse failure 時、この return は nil です。
string | nil
Parse failure 時の error message。Message は json.decodeSafe で prefixed され、near-position suffix を含みます。
number | nil
Parse failure 時の parser 由来の parser byte position。この return は failure 時のみ存在します。

型

DecodeOptions

JSON 解析動作を制御します。

例

json.decodeSafe-compatible alias を使い、status returns 付きで JSON を decode します。