Skip to content

Commit

Permalink
convert string true/false to booleans in addition to on/off
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncalabrese committed Mar 13, 2016
1 parent 8ddf600 commit fd4e975
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ function findExtendedSettings (envs) {
extended[enable] = exts;
var ext = _.camelCase(env.substring(split + 1).toLowerCase());
if (!isNaN(value)) { value = Number(value); }
if (typeof value === 'string' && value.toLowerCase() === 'on') { value = true; }
if (typeof value === 'string' && value.toLowerCase() === 'off') { value = false; }
if (typeof value === 'string' && (value.toLowerCase() === 'on' || value.toLowerCase() === 'true')) { value = true; }
if (typeof value === 'string' && (value.toLowerCase() === 'off' || value.toLowerCase() === 'false')) { value = false; }
exts[ext] = value;
}
}
Expand Down

0 comments on commit fd4e975

Please sign in to comment.