Editing Module:TypesLib
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 4: | Line 4: | ||
local i18n = cfg.i18n | local i18n = cfg.i18n | ||
local | local p = {} | ||
-- Deprecated, use lib.bool instead | -- Deprecated, use lib.bool instead | ||
function | function p.string_to_bool(val) | ||
return val == 'true' and val ~= 'false' | return val == 'true' and val ~= 'false' | ||
end | end | ||
function | function p.to_bool(val, cast_nil) | ||
local t = type(val) | local t = type(val) | ||
if (t == 'string') then | if (t == 'string') then | ||
Line 31: | Line 31: | ||
end | end | ||
return | return p |