Skip to content

Commit

Permalink
fix(codec): if a function is passed to encode then run it
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Jul 24, 2015
1 parent ed37783 commit ff05c74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/codec.js
Expand Up @@ -273,6 +273,9 @@ Codec.prototype.encode = function(val, buf, forceType) {
}
break;

case 'function':
return this.encode(val(), buf, forceType);

default:
throw new errors.NotImplementedError('encode(' + type + ')');
}
Expand Down

0 comments on commit ff05c74

Please sign in to comment.