Clean up coded formatting and add stronger typechecks

This commit is contained in:
2025-09-25 01:15:36 -04:00
parent 37b0efde84
commit d9eb143b4a
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -5,8 +5,8 @@ local fs = require("@lune/fs")
local types = require("./types") local types = require("./types")
export type CLI = { export type CLI = {
parseArgs: () -> types.opts, parseArgs: () -> types.opts,
printUsage: () -> (), printUsage: () -> (),
checkOutputFile: (outputFile: string?) -> () checkOutputFile: (outputFile: string?) -> ()
} }
@@ -14,8 +14,8 @@ local cli = {} :: CLI
-- parses command line arguments into options -- parses command line arguments into options
function cli.parseArgs(): types.opts function cli.parseArgs(): types.opts
local args = process.args local args: {string} = process.args
local opts = { local opts: types.opts = {
outputFile = nil, outputFile = nil,
directoryMode = false, directoryMode = false,
directoryPath = nil, directoryPath = nil,
+1 -1
View File
@@ -14,7 +14,7 @@ function compressionModule.zlibDecompress(contents: string, recursive: boolean?)
assert(typeof(contents) == "string", "Expected contents to be of type 'string'") assert(typeof(contents) == "string", "Expected contents to be of type 'string'")
if recursive == nil then recursive = false end if recursive == nil then recursive = false end
assert(typeof(recursive) == "boolean", "Expected recursive to be of type 'boolean'") 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 if not success then
return false return false
end end