From 45c7dd04f28ed4d67c67cf8d76df2ffa8936a91d Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 20 Apr 2015 17:54:18 +0200 Subject: [PATCH] fix(miniscore): _.defaults behavior for null (#41) Adjust the _.defaults behavior to match that of underscore and lodash to no longer treat `null` and `undefined` the same and only consider `undefined` for override. --- lib/hyperagent/miniscore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hyperagent/miniscore.js b/lib/hyperagent/miniscore.js index 196b38d..947f6dd 100644 --- a/lib/hyperagent/miniscore.js +++ b/lib/hyperagent/miniscore.js @@ -73,7 +73,7 @@ _.defaults = function (obj) { _.each(Array.prototype.slice.call(arguments, 1), function (source) { if (source) { for (var prop in source) { - if (obj[prop] === null || obj[prop] === undefined) { + if (obj[prop] === undefined) { obj[prop] = source[prop]; } }