From 6cfb2de17ccafd789d4af001934b286bc189d1a4 Mon Sep 17 00:00:00 2001 From: Scott Gress Date: Tue, 15 Mar 2016 11:38:37 -0500 Subject: [PATCH] Don't clone target function _.cloneDeep() of a function just returns {} in Lodash 3+, so the function is lost if you do: ``` 'GET /foo': {target: function(req, res){...}} ``` --- lib/router/bind.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/router/bind.js b/lib/router/bind.js index ecbb0e80bf..6286f3fd56 100644 --- a/lib/router/bind.js +++ b/lib/router/bind.js @@ -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]); }