aboutsummaryrefslogtreecommitdiff
path: root/libraries/json.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2024-03-08 13:35:12 -0500
committerAdam Harrison <adamdharrison@gmail.com>2024-03-08 13:35:12 -0500
commite1963ebc7f61cead5aa558d1a927b173077257fe (patch)
tree9992ccd41da8792cae9f3901b55629ac374b63b4 /libraries/json.lua
parent36da687203b80391d32e43475b9288468bea07c4 (diff)
downloadlite-xl-plugin-manager-e1963ebc7f61cead5aa558d1a927b173077257fe.tar.gz
lite-xl-plugin-manager-e1963ebc7f61cead5aa558d1a927b173077257fe.zip
cJSON addition.
Diffstat (limited to 'libraries/json.lua')
-rw-r--r--libraries/json.lua7
1 files changed, 7 insertions, 0 deletions
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