From 06f90289d8dc89d562f2b66cce6fd499a9a0e30e Mon Sep 17 00:00:00 2001 From: IgorTimofeev <11760002+IgorTimofeev@users.noreply.github.com> Date: Mon, 3 Jan 2022 20:38:04 +0700 Subject: [PATCH] Updated JSON API (markdown) --- JSON-API.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/JSON-API.md b/JSON-API.md index b2d681c..efbe25e 100644 --- a/JSON-API.md +++ b/JSON-API.md @@ -33,19 +33,19 @@ json.encode({ Result: ```lua -> { - "testString": "hello world", - "testTable": { - "testArray": [ +> "{ + \"testString\": \"hello world\", + \"testTable\": { + \ "testArray\": [ 1, 2, 3 ], - "testNumber": 123, - "testBool": true, - "testNil": nil + \"testNumber\": 123, + \"testBool\": true, + \"testNil\": nil } -} +}" ``` ### json.**decode**(*string* data): *mixed* result @@ -55,7 +55,7 @@ Attempts to interpret given `data` string as JSON object and convert it to Lua t Example: ```lua -json.decode("{ +json.decode({ \"test\": 123, \"hello\": \"world\" }") @@ -64,8 +64,8 @@ json.decode("{ Result: ```lua -> "{ +> { test = 123, - hell = "world" -}" + hello = "world" +} ``` \ No newline at end of file