function toLogObj(key, count) {
  const obj = JSON.parse(JSON.stringify(prototype));
  if (typeof key === 'string' && key.length > 0) obj.key = key;
  if (typeof +count === 'number' && count > 0) obj.count = +count;
  return obj;
} // toLogObj
/**
 * Generate a pubStats logging object.
 *
 * @param {String} key - The "publish" event key
 * @param {Integer} count - The number of events published to that key since
 *  the last logging interval
 * @returns {Object} a new pubStats logging object
 */
Generate a pubStats logging object.
@param {String} key - The "publish" event key
@param {Integer} count - The number of events published to that key since
the last logging interval
@returns {Object} a new pubStats logging object
Generate a pubStats logging object . @param { String } key - The " publish " event key @param { Integer } count - The number of events published to that key since the last logging interval @returns { Object } a new pubStats logging object
function toLogObj(key, count) {
  const obj = JSON.parse(JSON.stringify(prototype));
  if (typeof key === 'string' && key.length > 0) obj.key = key;
  if (typeof +count === 'number' && count > 0) obj.count = +count;
  return obj;
} 
function toLogObj ( key , count ) { const obj = JSON . parse ( JSON . stringify ( prototype ) ) ; if ( typeof key === 'string' && key . length > 0 ) obj . key = key ; if ( typeof + count === 'number' && count > 0 ) obj . count = + count ; return obj ; }
Generate a pubStats logging object.
Generate a pubStats logging object .
// toLogObj