Skip to content

Commit

Permalink
Don't clone target function
Browse files Browse the repository at this point in the history
_.cloneDeep() of a function just returns {} in Lodash 3+, so the function is lost if you do:
```
'GET /foo': {target: function(req, res){...}}
```
  • Loading branch information
sgress454 committed Mar 15, 2016
1 parent 1683055 commit 6cfb2de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/router/bind.js
Expand Up @@ -56,7 +56,7 @@ function bind( /* path, target, verb, options */ ) {
// If target is an object with a `target`, pull out the rest
// of the keys as route options and then bind the target.
else if (_.isPlainObject(target) && target.target) {
var _target = _.cloneDeep(target.target);
var _target = target.target;
options = _.merge(options, _.omit(target, 'target'));
bind.apply(this, [path, _target, verb, options]);
}
Expand Down

0 comments on commit 6cfb2de

Please sign in to comment.