Clean up coded formatting and add stronger typechecks
This commit is contained in:
+2
-2
@@ -14,8 +14,8 @@ local cli = {} :: CLI
|
||||
|
||||
-- parses command line arguments into options
|
||||
function cli.parseArgs(): types.opts
|
||||
local args = process.args
|
||||
local opts = {
|
||||
local args: {string} = process.args
|
||||
local opts: types.opts = {
|
||||
outputFile = nil,
|
||||
directoryMode = false,
|
||||
directoryPath = nil,
|
||||
|
||||
@@ -14,7 +14,7 @@ function compressionModule.zlibDecompress(contents: string, recursive: boolean?)
|
||||
assert(typeof(contents) == "string", "Expected contents to be of type 'string'")
|
||||
if recursive == nil then recursive = false end
|
||||
assert(typeof(recursive) == "boolean", "Expected recursive to be of type 'boolean'")
|
||||
local success, decompressed = pcall(function() return serde.decompress("zlib", contents) end)
|
||||
local success, decompressed: string = pcall(function() return serde.decompress("zlib", contents) end)
|
||||
if not success then
|
||||
return false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user