before calling the nested validation method,
makes a copy of the original object and calls with the copy of the object.
@param object
@returns {boolean}
170845
function isEmptyObj(object) {
    if(object === undefined)
        return true;

    var objToSend = JSON.parse(JSON.stringify(object));
    var result = nestedEmptyCheck(objToSend);
    if(JSON.stringify(result).indexOf('false') > -1)
        return false;
    return true;
}
534672
function(obj) {
		var prop;

		if (!obj || typeOf(obj) !== 'object') {
			return true;
		}

		for (prop in obj) {
			return false;
		}

		return true;
	}
350158
function _isValidAmbush(object) {
	return _isValidObject(object) &&
		_isValidId(object.id) &&
		_isUniqueId(null, object.id) &&
		_isValidCategory(object.category) &&
		_isValidAction(object.action);
}
1299145
function(object) {
		var methods = Array.prototype.slice.call(arguments).slice(1);
		if (!methods.length) {
			methods = gui.Object.ownmethods(object).filter(function(name) {
				return name[0] !== "_"; // exclude private methods
			});
		}
		methods.forEach(function(name) {
			object[name] = object[name].bind(object);
		});
		return object;
	}
285818
public static boolean isObject( Object obj ) {
      return !isNumber( obj ) && !isString( obj ) && !isBoolean( obj ) && !isArray( obj )
            && !isFunction( obj ) || isNull( obj );
   }
126223
function omit(obj) {
  var copy = {};
  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));
  for (var key in obj) {
    if (indexOf(keys, key) == -1) copy[key] = obj[key];
  }
  return copy;
}
812987
function booleanFalse(validatedObject, errorText) {
  if (!_.isBoolean(validatedObject) || validatedObject) {
    throw new ValidationError(errorText || 'Validated object is not False');
  }
  return validatedObject;
}
309674
function copy(object) {
  // a quick copy
  var copy = {};
  for (var i in object) {
    copy[i] = object[i];
  }
  return copy;
}
1125596
public final static boolean isPrimitive(Object object) {
        if (object instanceof String || object instanceof Number || object instanceof Boolean
                || object instanceof Character) {
            return true;
        }
        return false;
    }
857770
function clone(obj, deep) {

    if (!obj || typeof obj !== "object" || isFunction(obj)) {
        // null, undefined, any non-object, or function
        return obj;   // anything
    }
    if (obj instanceof Date) {
        // Date
        return new Date(obj.getTime());   // Date
    }
    var result, index, length, value;
    if (isArray(obj)) {
        // array
        result = [];
        if (deep) {
            for (index = 0, length = obj.length; index < length; index += 1) {
                if (index in obj) {
                    value = obj[index];
                    value = value.clone ? value.clone(true) : clone(value);
                    result.push(clone(value));
                }
            }
        } else {
            for (index = 0, length = obj.length; index < length; index += 1) {
                if (index in obj) {
                    result.push(value);
                }
            }
        }
        return result;
    }

    //Default implementation
    if (obj.clone) {
        return obj.clone(obj, deep);
    }

    // generic objects
    result = obj.constructor ? new obj.constructor() : {};

    for (index in obj) {
        if (true) {//jslint validation
            value = obj[index];
            if (
                !(index in result) ||
                (result[index] !== value && (!(index in EMPTY) || EMPTY[index] !== value))
            ) {
                result[index] = clone(value);
            }
        }
    }

    return result; // Object
}
767109
function (obj) {
            var self = this;
            this.validate(obj).chain(function (valid) {
                var index;
                if (self.count <= self.__maxObjects && valid && (index = self.__inUseObjects.indexOf(obj)) > -1) {
                    self.__inUseObjects.splice(index, 1);
                    self.__freeObjects.enqueue(obj);
                    self.__checkQueries();
                } else {
                    self.removeObject(obj);
                }
            });
        }
162607
function( target, object ) {
    if ((
      typeof target === 'object' ||
      typeof target === 'function' ) &&
      typeof object === 'object'
    ) {
      for ( var name in object ) {
        if (object.hasOwnProperty( name )) {
          target[ name ] = object[ name ]
        }
      }
    }
    return target
  }
1039103
function _isValidObject(object) {
	if (!object || Array.isArray(object) || typeof(object) !== 'object') {
		logger('AMBUSH_INVALID_DATA');
		return false;
	}

	return true;
}
1127266
function isValidObject(key) {
  const isValid = VALID_TRACKING_OBJECTS.indexOf(key) !== -1;
  if (!isValid) {
    console.log(chalk.red('Tracking Error:'));
    console.log(`"${key}" is invalid tracking object. Must be one of`, VALID_TRACKING_OBJECTS);
  }
  return isValid;
}
170248
function (object) {
		if (!object || object._bsontype)
			return object;

		if (_.isString(object))
			return object.replace(/\./g, "U+FF0E").replace(/\$/g, "U+FF04");

		var newObject = _.isArray(object) ? [ ] : { };

		Object.keys(object).forEach(function (key) {
			var sKey = key;
			
			if (/[.|$]/.test(key)) {
				sKey = mongojs.util.sanitise(key);
				newObject[sKey] = object[key];
			} else {
				newObject[key] = object[key];
			}
			
			// Recurse
			if (isObject(newObject[sKey]))
				newObject[sKey] = this.sanitise(newObject[sKey]);
		}.bind(this));
		
		return newObject;
	}
421280
private static boolean isArrayLike(Object object)
  {
    return object != null && (object.getClass().isArray() || object instanceof Collection);
  }
905836
function nestedEmptyCheck(obj) {

    if(obj === "null") {
        return true;
    }

    else if(typeof obj === "boolean"){
        return false;
    }

    else if(typeof obj === "number"){
        return false;
    }

    else if((typeof obj === "string") && obj.trim() != ''){
        return false;
    } else if((typeof obj === "string") && obj.trim() === ''){
        return true;
    }

    else if(Array.isArray(obj)){
        if(obj.length === 0) {
            return true;
        } else {
            for(var i = 0; i < obj.length; i++) {
                obj[i] = nestedEmptyCheck(obj[i]);
            }
            return obj;
        }
    }

    else if(typeof obj === "object"){
        var primaryKeys = Object.keys(obj);
        if(primaryKeys && primaryKeys.length === 0) {
            return true;
        } else {
            primaryKeys.forEach(key => {
                var value = nestedEmptyCheck(obj[key]);
            obj[key] = value;
        });
            return obj;
        }
    }
    return obj;
}