1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-26 12:45:20 +03:00
aports/community/lua-turbo/0001-use-cjson-instead-of-JSON.lua.patch
Carlo Landmeter bb4ebf8c9c community/lua-turbo: upgrade to 2.1.3
change ssl to libressl which has ssl 1.0
2019-10-16 14:43:26 +00:00

29 lines
749 B
Diff

--- ./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