This commit is contained in:
Andrew Miner
2026-10-29 23:13:32 -06:00
parent 267349a830
commit 079df8575e
7 changed files with 127 additions and 59 deletions
+21
View File
@@ -0,0 +1,21 @@
-- Private -----------------------------------------------------------------------------------------
local private = {}
function private.is_key(name, value, table_name, table_value)
if table_value[value] ~= nil then return end
error(name.." should be a key in "..table_name..", but "..value.." isn't present")
end
function private.is_type(name, value, type_name)
if type(value) == type_name then return end
error(name.." should be a "..type_name..", but was a "..type(value))
end
-- Export ------------------------------------------------------------------------------------------
return {
is_key = private.is_key,
is_type = private.is_type
}