Skip to content

Commit 14aca9f

Browse files
committed
Make value check more generic
1 parent c940d71 commit 14aca9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ const convert = {
5353
return +value;
5454
},
5555
bool: function(value) {
56-
const isBool = value === 'true' || value === 'false' || value === 'TRUE' || value === 'FALSE';
56+
const isBool = (value || '').toLowerCase() === 'true' || (value || '').toLowerCase() === 'false';
5757
if (!isBool) {
5858
throw new Error('GetEnv.NoBoolean: ' + value + ' is not a boolean.');
5959
}
6060

61-
return value === 'true' || value === 'TRUE';
61+
return (value || '').toLowerCase() === 'true';
6262
},
6363
boolish: function(value) {
6464
try {

0 commit comments

Comments
 (0)