'use strict';

/**
 * Require modules.
 */

var isObject = require('is-object');

/**
 * Pick values from object except the given keys.
 *
 * @param {object} obj
 * @param {array|string}
 *
 * @return {object}
 */

module.exports = function except(obj, keys) {
  if (!isObject(obj)) {
    throw new Error('`obj` should be object');
  }

  if (typeof keys === 'string') {
    keys = [keys];
  }

  if (keys instanceof Array === false) {
    throw new Error('`keys` should be array');
  }

  for (var i = 0, l = keys.length; i < l; i++) {
    var parts = keys[i].split('.');
    var first = parts.shift();
    var value = obj[first];

    if (isObject(value) && parts.length > 0) {
      except(obj[first], parts);
      delete obj[first];
    }

    if (obj[first] !== undefined) {
      delete obj[first];
    }
  }

  return obj;
};

@@ -716,70 +716,283 @@
     
-delete obj%5Bfirst%5D;%0A    %7D%0A%0A    if (obj%5Bfirst%5D !== undefined)
+if (isObject(obj%5Bfirst%5D) && !Object.keys(obj%5Bfirst%5D).length) %7B%0A        delete obj%5Bfirst%5D;%0A      %7D%0A    %7D else %7B%0A      delete obj%5Bfirst%5D;%0A    %7D%0A  %7D%0A%0A/*      if (isObject(obj)) %7B%0A         if (!Object.keys(obj).length) %7B%0A           delete obj%5Bfirst%5D;%0A         %7D%0A      %7D else
  %7B%0A
+  
     
@@ -1016,21 +1016,31 @@
 t%5D;%0A    
+  
 %7D%0A  
+ 
-%7D
+ %7D%0A  */%0A
 %0A%0A  retu

Fix deleting of empty obj