function minimize(obj) {
  var keys = Object.keys(obj),
      i = keys.length,
      hasKeys,
      key,
      val;

  while (i--) {
    key = keys[i];
    val = obj[key];

    if (utils.isObject(val) && !Buffer.isBuffer(val)) {
      obj[key] = minimize(val);
    }

    if (undefined === obj[key]) {
      delete obj[key];
      continue;
    }

    hasKeys = true;
  }

  return hasKeys
      ? obj
      : undefined;
}
/*!
 * Minimizes an object, removing undefined values and empty objects
 *
 * @param {Object} object to minimize
 * @return {Object}
 */
Minimizes an object, removing undefined values and empty objects
@param {Object} object to minimize
@return {Object}
Minimizes an object removing undefined values and empty objects @param { Object } object to minimize @return { Object }
function minimize(obj) {
  var keys = Object.keys(obj),
      i = keys.length,
      hasKeys,
      key,
      val;
  while (i--) {
    key = keys[i];
    val = obj[key];
    if (utils.isObject(val) && !Buffer.isBuffer(val)) {
      obj[key] = minimize(val);
    }
    if (undefined === obj[key]) {
      delete obj[key];
      continue;
    }
    hasKeys = true;
  }
  return hasKeys
      ? obj
      : undefined;
}
function minimize ( obj ) { var keys = Object . keys ( obj ) , i = keys . length , hasKeys , key , val ; while ( i -- ) { key = keys [ i ] ; val = obj [ key ] ; if ( utils . isObject ( val ) && ! Buffer . isBuffer ( val ) ) { obj [ key ] = minimize ( val ) ; } if ( undefined === obj [ key ] ) { delete obj [ key ] ; continue ; } hasKeys = true ; } return hasKeys ? obj : undefined ; }
Minimizes an object, removing undefined values and empty objects
 @param {Object} object to minimize
 @return {Object}
Minimizes an object removing undefined values and empty objects @param { Object } object to minimize @return { Object }