github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/themes/wind/static/libs/sockjs-client-1.1.0/lib/utils/object.js (about)

     1  'use strict';
     2  
     3  module.exports = {
     4    isObject: function(obj) {
     5      var type = typeof obj;
     6      return type === 'function' || type === 'object' && !!obj;
     7    }
     8  
     9  , extend: function(obj) {
    10      if (!this.isObject(obj)) {
    11        return obj;
    12      }
    13      var source, prop;
    14      for (var i = 1, length = arguments.length; i < length; i++) {
    15        source = arguments[i];
    16        for (prop in source) {
    17          if (Object.prototype.hasOwnProperty.call(source, prop)) {
    18            obj[prop] = source[prop];
    19          }
    20        }
    21      }
    22      return obj;
    23    }
    24  };