JSON-like value stringification
Version 0.1.8
Chadnaut 2024
https://github.com/Chadnaut/Attract-Mode-Modules
::fe.load_module("stringify");
local object = { a = 1, b = 2.0, c = ["d", "e"] };
print(stringify(object) + "\n");{ a = 1, b = 2.0, c = ["d", "e"] }
Pretty printing:
print(stringify(object, " ") + "\n");{
a = 1,
b = 2.0,
c = [
"d",
"e"
]
}
Pass stringify any value and it will convert it into a string, handy for printing to last_run.log.
stringify(value, space?)- Returns a string.valueany - The value to stringify.spacestring - (Optional) Indent for pretty-printing.