Bump to v3.6.0.

This commit is contained in:
jdalton
2015-03-24 16:44:49 -07:00
parent 06f6ffa303
commit d58549ce0b
192 changed files with 2218 additions and 1804 deletions

View File

@@ -4,7 +4,8 @@ var arrayMap = require('../internal/arrayMap'),
bindCallback = require('../internal/bindCallback'),
keysIn = require('./keysIn'),
pickByArray = require('../internal/pickByArray'),
pickByCallback = require('../internal/pickByCallback');
pickByCallback = require('../internal/pickByCallback'),
restParam = require('../function/restParam');
/**
* The opposite of `_.pick`; this method creates an object composed of the
@@ -12,7 +13,7 @@ var arrayMap = require('../internal/arrayMap'),
* Property names may be specified as individual arguments or as arrays of
* property names. If `predicate` is provided it is invoked for each property
* of `object` omitting the properties `predicate` returns truthy for. The
* predicate is bound to `thisArg` and invoked with three arguments;
* predicate is bound to `thisArg` and invoked with three arguments:
* (value, key, object).
*
* @static
@@ -34,18 +35,18 @@ var arrayMap = require('../internal/arrayMap'),
* _.omit(object, _.isNumber);
* // => { 'user': 'fred' }
*/
function omit(object, predicate, thisArg) {
var omit = restParam(function(object, props) {
if (object == null) {
return {};
}
if (typeof predicate != 'function') {
var props = arrayMap(baseFlatten(arguments, false, false, 1), String);
if (typeof props[0] != 'function') {
var props = arrayMap(baseFlatten(props), String);
return pickByArray(object, baseDifference(keysIn(object), props));
}
predicate = bindCallback(predicate, thisArg, 3);
var predicate = bindCallback(props[0], props[1], 3);
return pickByCallback(object, function(value, key, object) {
return !predicate(value, key, object);
});
}
});
module.exports = omit;