From e1963ebc7f61cead5aa558d1a927b173077257fe Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Fri, 8 Mar 2024 13:35:12 -0500 Subject: cJSON addition. --- libraries/json.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libraries/json.lua') diff --git a/libraries/json.lua b/libraries/json.lua index c463440..3499195 100644 --- a/libraries/json.lua +++ b/libraries/json.lua @@ -385,5 +385,12 @@ function json.decode(str) return res end +local status, cjson = pcall(require, "libraries.cjson") +if status then + json.ldecode = json.decode + json.lencode = json.encode + json.decode = cjson.decode + json.encode = cjson.encode +end return json -- cgit v1.2.3