diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-12-11 21:03:53 +0100 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-12-11 21:03:53 +0100 |
commit | 281539cf53b8ec43d72e06cbdba874b2de6e758d (patch) | |
tree | 9dc539f574e424247458beade553cdffbed59707 /lualibs-boolean.lua | |
parent | ee53358e267a7946608e66775047085b815b8608 (diff) | |
download | lualibs-281539cf53b8ec43d72e06cbdba874b2de6e758d.tar.gz |
sync with Context as of 2014-12-11
Diffstat (limited to 'lualibs-boolean.lua')
-rw-r--r-- | lualibs-boolean.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lualibs-boolean.lua b/lualibs-boolean.lua index 8d11080..8f18d4c 100644 --- a/lualibs-boolean.lua +++ b/lualibs-boolean.lua @@ -57,11 +57,11 @@ function string.booleanstring(str) end end -function string.is_boolean(str,default) +function string.is_boolean(str,default,strict) if type(str) == "string" then - if str == "true" or str == "yes" or str == "on" or str == "t" or str == "1" then + if str == "true" or str == "yes" or str == "on" or str == "t" or (not strict and str == "1") then return true - elseif str == "false" or str == "no" or str == "off" or str == "f" or str == "0" then + elseif str == "false" or str == "no" or str == "off" or str == "f" or (not strict and str == "0") then return false end end |