aboutsummaryrefslogtreecommitdiff
path: root/community/lua-turbo/0001-use-cjson-instead-of-JSON.lua.patch
blob: 9453dae0bf57975e305f9e25b778dddf738d45d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- ./turbo/escape.lua.orig
+++ ./turbo/escape.lua
@@ -20,7 +20,7 @@
 -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 -- SOFTWARE."
 
-local json = require('turbo.3rdparty.JSON')
+local json = require('cjson')
 
 local escape = {} -- escape namespace
 
@@ -28,7 +28,7 @@
 -- @param t Value to JSON encode.
 -- @note May raise a error if table could not be decoded.
 function escape.json_encode(t)
-    return json:encode(t)
+    return json.encode(t)
 end
 
 --- Decode a JSON string to table.
@@ -36,7 +36,7 @@
 -- Lua primitives.
 -- @return (Table)
 function escape.json_decode(s)
-    return json:decode(s)
+    return json.decode(s)
 end
 
 local function _unhex(hex) return string.char(tonumber(hex, 16)) end