Initial commit

This commit is contained in:
2025-03-06 01:39:36 +07:00
commit 9d00ee4e47
35 changed files with 587 additions and 0 deletions

9
mods/API/Ensure/init.lua Normal file
View File

@@ -0,0 +1,9 @@
--- Validates a function argument's type and throws a descriptive error on mismatch.
--- @param variable any The argument value to type-check
--- @param expected_type string Expected Lua type name (e.g., "number", "table", "string")
--- @param n number Argument position in function call (1-based index)
--- @param func string Name of the parent function for error reporting
function ensure_arg_type(variable, expected_type, n, func)
local actual_type = type(variable)
assert(actual_type == expected_type, 'bad argument #%s to \'%s\' (%s expected, got %s)', tostring(n), func, expected_type, actual_type)
end

2
mods/API/Ensure/mod.conf Normal file
View File

@@ -0,0 +1,2 @@
name = api__ensure
depends =