Rename unstring to parse

This commit is contained in:
NullBite 2023-06-21 15:18:55 -04:00
parent cc084d355b
commit 9e64a077e1
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -96,7 +96,9 @@ do
buffer[#buffer + 1] = '"???' .. _type .. '???"' buffer[#buffer + 1] = '"???' .. _type .. '???"'
end end
end end
--- Dumps object as UNSAFE json, i stole this from stackoverflow so i could use json.tool to format it so it's easier to read --- Dumps object as UNSAFE json, i stole this from stackoverflow so i could
-- use json.tool to format it so it's easier to read
-- TL;DR, do NOT use this as an actual JSON implementation
function dumpJSON(obj) function dumpJSON(obj)
if obj == nil then return "null" else if obj == nil then return "null" else
local buffer = {} local buffer = {}
@ -131,7 +133,7 @@ function splitstring (inputstr, sep)
end end
---@param input string ---@param input string
function unstring(input) function parse(input)
if input=="nil" then if input=="nil" then
return nil return nil
elseif input == "true" or input == "false" then elseif input == "true" or input == "false" then
@ -418,7 +420,7 @@ do
savedData=data.loadAll() savedData=data.loadAll()
end end
skin_state=mergeTable( skin_state=mergeTable(
map(unstring,data.loadAll()), map(parse,data.loadAll()),
defaults) defaults)
else else
skin_state=defaults skin_state=defaults