lib/general-utils.js
function(obj, maxNumProperties) {
      var result = "";

      maxNumProperties = maxNumProperties === undefined ? Number.MAX_VALUE : maxNumProperties;

      if (obj !== undefined && obj !== null) {
        var separator = "";

        var propCount = 0;
        for (var propertyName in obj) {
          var objValue;

          if ((obj[propertyName]) === undefined) {
            objValue = "*** undefined ***";
          } else {
            objValue = obj[propertyName];
          }

          result += separator + propertyName + " = " + objValue;
          separator = ",\n";
          propCount++;

          if (propCount >= maxNumProperties) {
            break;
          }
        }
      }

      return result;
    }
function(obj, maxNumProperties) {
      var result = "";

      maxNumProperties = maxNumProperties === undefined ? Number.MAX_VALUE : maxNumProperties;

      if (obj !== undefined && obj !== null) {
        var separator = "";

        var propCount = 0;
        for (var propertyName in obj) {
          var objValue;

          if ((obj[propertyName]) === undefined) {
            objValue = "*** undefined ***";
          } else {
            objValue = obj[propertyName];
          }

          result += separator + propertyName + " = " + objValue;
          separator = ",\n";
          propCount++;

          if (propCount >= maxNumProperties) {
            break;
          }
        }
      }

      return result;
    }
function ( obj , maxNumProperties ) { var result = "" ; maxNumProperties = maxNumProperties === undefined ? Number . MAX_VALUE : maxNumProperties ; if ( obj !== undefined && obj !== null ) { var separator = "" ; var propCount = 0 ; for ( var propertyName in obj ) { var objValue ; if ( ( obj [ propertyName ] ) === undefined ) { objValue = "*** undefined ***" ; } else { objValue = obj [ propertyName ] ; } result += separator + propertyName + " = " + objValue ; separator = ",\n" ; propCount ++ ; if ( propCount >= maxNumProperties ) { break ; } } } return result ; }
Return a String, of the form "propertyName = propertyValue\n", for every property of the given obj, or until
maxNumProperties has been reached.

@param obj object to retrieve the properties from.
@param maxNumProperties optional limiter for the number of properties to retrieve.
@returns {string} new-line separated set of property/value pairs
Return a String of the form propertyName = propertyValue \ n for every property of the given obj or until maxNumProperties has been reached .