Skip to content

Commit

Permalink
Merge f441f26 into 73111f7
Browse files Browse the repository at this point in the history
  • Loading branch information
dhakerShiv committed Oct 9, 2019
2 parents 73111f7 + f441f26 commit a756731
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/purify.js
Expand Up @@ -8,7 +8,9 @@ module.exports = (function () {
purify.boolean = function (rawValue, defaultValue) {
if (typeof rawValue === 'boolean') {
return rawValue;
} else if (typeof rawValue === 'string') {
}

if (typeof rawValue === 'string') {
var isTrue = /^(?:1|on|true|yes)$/i.test(rawValue),
isFalse = /^(?:0|off|false|no)$/i.test(rawValue);
return isTrue ? true : (isFalse ? false : defaultValue);
Expand Down

0 comments on commit a756731

Please sign in to comment.