From e7563787be5b3a9c1de66a7f4eb16ed09d9d4a21 Mon Sep 17 00:00:00 2001 From: Autumn Date: Sun, 17 May 2026 17:22:58 +0100 Subject: [main] added ability to fetch service & tidied up functions --- src/utils.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/utils.lua') diff --git a/src/utils.lua b/src/utils.lua index 83e1d46..5851e1c 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -27,3 +27,27 @@ function table.extracthex(response, start, last) return result end + +-- table -> pretty print +function table.dump(response) + + if type(response) == "table" then + + local start = "{ " + + for key, value in pairs(response) do + + if type(key) ~= "number" then key = '"' .. key .. '"' end + + start = start .. "[" .. key .. "] = " .. table.dump(value) .. "," + + end + + return start .. "} " + + else + + return tostring(response) + + end +end -- cgit v1.3