Skip to main content

Argumenty

string
wymagane
JSON string do parse. Function czyta ten argument przez string type checking.
DecodeOptions
Optional decode options. boolean ustawia useNull. table moze ustawic useNull i maxDepth.

Zwroty

boolean
true, gdy parsing sie powiedzie, false, gdy parsing zawiedzie w protected parse block.
any | nil
Decoded value przy success. Przy parse failure ten return to nil.
string | nil
Error message przy parse failure. Message jest prefixed przez json.decodeSafe i zawiera near-position suffix.
number | nil
Parser byte position z parser przy parse failure. Ten return wystepuje tylko przy failure.

Typy

DecodeOptions

Kontroluje zachowanie analizy JSON.

Przykład

Decode JSON ze status returns przez json.decodeSafe-compatible alias.