Skip to content

Commit

Permalink
docs(env): found a bug that will generate a breaking-change when fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
FGRibreau committed Nov 4, 2015
1 parent 5b25c2b commit 1e66d7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module.exports = function envFactory() {
throw new Error('Common-env: $aliases must be defined along side $default, key: ' + fullKeyName);
}

// if `$type` is specified it will be used as a type checker and converter, otherwise infer the type from ``$default`
var $typeConverter = object.$type || getTypeConverter(object.$default);

return object.$aliases.concat([fullKeyName]).reduce(function (memo, varEnvName, i, aliases) {
Expand Down Expand Up @@ -132,7 +133,7 @@ module.exports = function envFactory() {
function getTypeConverter($default) {
return isArrayOfAtom($default) ? arrayTypeConverter($default) : function (value) {

if (_.isNumber($default)) {
if (_.isNumber($default)) { // @todo it's a bug, it should be types.seems.Integer, changing this will be a breaking change
return toInt(value);
}

Expand Down

0 comments on commit 1e66d7a

Please sign in to comment.