summaryrefslogtreecommitdiff
path: root/lualibs-boolean.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2015-11-21 16:57:19 +0100
committerPhilipp Gesang <phg@phi-gamma.net>2015-11-21 16:57:19 +0100
commit8401067436d466b62459283139aa5f7bdf5be0c8 (patch)
treee4ba77b39dc3c3fe6eb5f3a66513afb32c5990ca /lualibs-boolean.lua
parent13e578a1d0f803d8ec7d42d70bb6f773a44e84b0 (diff)
parent7d8afd6591e978a6a85bf29bbcdbeb3e3936d4d5 (diff)
downloadlualibs-8401067436d466b62459283139aa5f7bdf5be0c8.tar.gz
Merge pull request #27 from phi-gamma/master
latest changes
Diffstat (limited to 'lualibs-boolean.lua')
-rw-r--r--lualibs-boolean.lua6
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