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합니다.