diff --git a/lib/bunyan.js b/lib/bunyan.js index e6e29a4..7f37d84 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -55,16 +55,18 @@ var isBrowser = function () { //---- Internal support stuff function objCopy(obj) { - if (obj === null) { - return null; + if (obj == null) { + return obj; } else if (Array.isArray(obj)) { return obj.slice(); - } else { + } else if (typeof obj === 'object') { var copy = {}; Object.keys(obj).forEach(function (k) { copy[k] = obj[k]; }); return copy; + } else { + return obj; } }