diff --git a/lib/utils.js b/lib/utils.js index d4e19566..d325ffdb 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -50,7 +50,7 @@ var merge = function merge(target, source, options) { return target; } - if (typeof source !== 'object') { + if (typeof source !== 'object' && typeof source !== 'function') { if (isArray(target)) { target.push(source); } else if (target && typeof target === 'object') { diff --git a/test/utils.js b/test/utils.js index 21429937..7a4ff1b2 100644 --- a/test/utils.js +++ b/test/utils.js @@ -38,8 +38,8 @@ test('merge()', function (t) { func.bar = 'baz'; t.deepEqual( utils.merge({ foo: 'bar' }, func), - { foo: 'bar', 'function f() {}': true }, - 'functions can not be merge sources' + { foo: 'bar', bar: 'baz' }, + 'functions can be merge sources' ); t.test(