Many things are working

This commit is contained in:
RingOfStorms (Joshua Bell) 2024-05-01 17:33:08 -05:00
parent c42f197307
commit 4582bd5469
20 changed files with 715 additions and 300 deletions

View file

@ -63,6 +63,7 @@ function M.keymap(keymap)
end
end
-- spread({})({})
function M.spread(template)
local result = {}
for key, value in pairs(template) do
@ -77,6 +78,14 @@ function M.spread(template)
end
end
-- assign({}, {})
function M.assign(obj, assign)
for key, value in pairs(assign) do
obj[key] = value
end
return obj
end
function M.table_contains(table, element)
for _, value in pairs(table) do
if value == element then
@ -109,4 +118,30 @@ function M.highlight(group, options)
)
end
function M.safeRequire(module, func, errorFunc)
local ok, result = pcall(require, module)
if ok then
return func(result)
elseif errorFunc then
return errorFunc(result)
end
return nil
end
function M.fnFalse()
return false
end
function M.fnNil()
return nil
end
function M.fnEmptyStr()
return ""
end
function M.fnZero()
return 0
end
return M