2 * object.omit <https://github.com/jonschlinkert/object.omit>
4 * Copyright (c) 2014-2015, Jon Schlinkert.
5 * Licensed under the MIT License.
10 var isObject = require('is-extendable');
11 var forOwn = require('for-own');
13 module.exports = function omit(obj, keys) {
14 if (!isObject(obj)) return {};
16 keys = [].concat.apply([], [].slice.call(arguments, 1));
17 var last = keys[keys.length - 1];
20 if (typeof last === 'function') {
24 var isFunction = typeof fn === 'function';
25 if (!keys.length && !isFunction) {
29 forOwn(obj, function(value, key) {
30 if (keys.indexOf(key) === -1) {
34 } else if (fn(value, key, obj)) {