dist/uri.js.js
function() {

      // Not as nice as arguments.callee but at least we'll only have on reference.
      var _this = this;
      var extend = function() { return _this.extend.apply(_this, arguments); };

      // If we don't have enough arguments to do anything, just return an object
      if (arguments.length < 2) {
        return {};
      }

      // Argument shuffling
      if (typeof arguments[0] !== 'boolean') {
        Array.prototype.unshift.call(arguments, true);
      }

      // Remove the variables we need from the arguments stack.
      var deep = Array.prototype.shift.call(arguments);
      var one = Array.prototype.shift.call(arguments);
      var two = Array.prototype.shift.call(arguments);

      // If we have more than two objects to merge
      if (arguments.length > 0) {

        // Push two back on to the arguments stack, it's no longer special.
        Array.prototype.unshift.call(arguments, two);

        // While we have any more arguments, call extend with the initial obj and the next argument
        while (arguments.length > 0) {
          two = Array.prototype.shift.call(arguments);

          if (typeof two !== 'object') continue;

          one = extend(deep, one, two);
        }

        return one;
      }

      // Do some checking to force one and two to be objects
      if (typeof one !== 'object') {
        one = {};
      }

      if (typeof two !== 'object') {
        two = {};
      }

      // Loop through the second object to merge it with the first
      for (var key in two) {
        // If this key actually belongs to the second argument
        if (Object.prototype.hasOwnProperty.call(two, key)) {
          var current = two[key];

          if (deep && typeof current === 'object' && typeof one[key] === 'object') {
            // Deep copy
            one[key] = extend(one[key], current);
          } else {
            one[key] = current;
          }
        }
      }

      return one;
    }
function() {

      // Not as nice as arguments.callee but at least we'll only have on reference.
      var _this = this;
      var extend = function() { return _this.extend.apply(_this, arguments); };

      // If we don't have enough arguments to do anything, just return an object
      if (arguments.length < 2) {
        return {};
      }

      // Argument shuffling
      if (typeof arguments[0] !== 'boolean') {
        Array.prototype.unshift.call(arguments, true);
      }

      // Remove the variables we need from the arguments stack.
      var deep = Array.prototype.shift.call(arguments);
      var one = Array.prototype.shift.call(arguments);
      var two = Array.prototype.shift.call(arguments);

      // If we have more than two objects to merge
      if (arguments.length > 0) {

        // Push two back on to the arguments stack, it's no longer special.
        Array.prototype.unshift.call(arguments, two);

        // While we have any more arguments, call extend with the initial obj and the next argument
        while (arguments.length > 0) {
          two = Array.prototype.shift.call(arguments);

          if (typeof two !== 'object') continue;

          one = extend(deep, one, two);
        }

        return one;
      }

      // Do some checking to force one and two to be objects
      if (typeof one !== 'object') {
        one = {};
      }

      if (typeof two !== 'object') {
        two = {};
      }

      // Loop through the second object to merge it with the first
      for (var key in two) {
        // If this key actually belongs to the second argument
        if (Object.prototype.hasOwnProperty.call(two, key)) {
          var current = two[key];

          if (deep && typeof current === 'object' && typeof one[key] === 'object') {
            // Deep copy
            one[key] = extend(one[key], current);
          } else {
            one[key] = current;
          }
        }
      }

      return one;
    }
function ( ) { // Not as nice as arguments.callee but at least we'll only have on reference. var _this = this ; var extend = function ( ) { return _this . extend . apply ( _this , arguments ) ; } ; // If we don't have enough arguments to do anything, just return an object if ( arguments . length < 2 ) { return { } ; } // Argument shuffling if ( typeof arguments [ 0 ] !== 'boolean' ) { Array . prototype . unshift . call ( arguments , true ) ; } // Remove the variables we need from the arguments stack. var deep = Array . prototype . shift . call ( arguments ) ; var one = Array . prototype . shift . call ( arguments ) ; var two = Array . prototype . shift . call ( arguments ) ; // If we have more than two objects to merge if ( arguments . length > 0 ) { // Push two back on to the arguments stack, it's no longer special. Array . prototype . unshift . call ( arguments , two ) ; // While we have any more arguments, call extend with the initial obj and the next argument while ( arguments . length > 0 ) { two = Array . prototype . shift . call ( arguments ) ; if ( typeof two !== 'object' ) continue ; one = extend ( deep , one , two ) ; } return one ; } // Do some checking to force one and two to be objects if ( typeof one !== 'object' ) { one = { } ; } if ( typeof two !== 'object' ) { two = { } ; } // Loop through the second object to merge it with the first for ( var key in two ) { // If this key actually belongs to the second argument if ( Object . prototype . hasOwnProperty . call ( two , key ) ) { var current = two [ key ] ; if ( deep && typeof current === 'object' && typeof one [ key ] === 'object' ) { // Deep copy one [ key ] = extend ( one [ key ] , current ) ; } else { one [ key ] = current ; } } } return one ; }
Deep merge two or more objects
@param {boolean} deep Should this be a deep copy or not?
@return {object}    Merged version of the arguments
Deep merge two or more objects