mirror of
https://github.com/TangentFoxy/lume.git
synced 2026-03-14 12:46:51 -06:00
Changed lume.format() to abort early if vars is nil
This commit is contained in:
@@ -231,7 +231,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function lume.format(str, vars)
|
function lume.format(str, vars)
|
||||||
vars = vars or {}
|
if not vars then return str end
|
||||||
local f = function(x) return tostring(vars[x] or "{" .. x .. "}") end
|
local f = function(x) return tostring(vars[x] or "{" .. x .. "}") end
|
||||||
return (str:gsub("{(.-)}", f))
|
return (str:gsub("{(.-)}", f))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user