diff options
Diffstat (limited to 'libraries/json.lua')
-rw-r--r-- | libraries/json.lua | 7 |
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 |