just a suggestion to shorten the lines at Load private function
instead of these if statements,
local ClassType = ""
if typeof(V) == "table" then
ClassType = "Folder"
elseif typeof(V) == "string" then
ClassType = "StringValue"
elseif typeof(V) == "number" then
ClassType = "NumberValue"
elseif typeof(V) == "boolean" then
ClassType = "BoolValue"
end
you can shorten it to
local function title(s)
return s:sub(1, 1):upper() .. s:sub(2, #s)
end
local _type = type(V)
local instanceType = _type == "table" and "Folder" or `{title(_type)}Value`
instanceType = _type == "boolean" and "BoolValue" or instanceType -- an exception cause "BooleanValue" doesn't exists
Cool idea, but I don’t see any reason to use this as it just falls short in the sea of already existing datastores, like ProfileService and Datastore2.
just noticed that you’re not using OOP, and just setting a variable in the module to the datastoreName that has been initialized, which is a problem when you need to use more than 1 datastore (or you could require and call init for every datastore)