chore: format runtime with stylua

This commit is contained in:
Christian Clason
2022-05-09 11:23:51 +02:00
parent 676e9e9334
commit aefdc6783c
37 changed files with 4198 additions and 3569 deletions

View File

@@ -5,13 +5,17 @@ local F = {}
---@param a
---@param b
function F.if_nil(a, b)
if a == nil then return b end
if a == nil then
return b
end
return a
end
-- Use in combination with pcall
function F.ok_or_nil(status, ...)
if not status then return end
if not status then
return
end
return ...
end
@@ -29,7 +33,7 @@ end
--- like {...} except preserve the length explicitly
function F.pack_len(...)
return {n=select('#', ...), ...}
return { n = select('#', ...), ... }
end
--- like unpack() but use the length set by F.pack_len if present