code: function (obj) {
          if (
              !obj
              || {}.toString.call(obj) !== '[object Object]'
              || obj.nodeType
              || obj.setInterval
          ) {
              return false
          }
  
          var hasOwn              = {}.hasOwnProperty;
          var hasOwnConstructor   = hasOwn.call(obj, 'constructor');
          // added test for node > v6
          var hasMethodPrototyped = ( typeof(obj.constructor) != 'undefined' ) ? hasOwn.call(obj.constructor.prototype, 'isPrototypeOf') : false;
  
  
          if (
              obj.constructor && !hasOwnConstructor && !hasMethodPrototyped
          ) {
              return false
          }
  
          //Own properties are enumerated firstly, so to speed up,
          //if last one is own, then all properties are own.
          var key;
          return key === undefined || hasOwn.call(obj, key)
      }
docs: Check if object before merging.