mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Bump to v4.14.0.
This commit is contained in:
11
omitBy.js
11
omitBy.js
@@ -1,5 +1,6 @@
|
||||
import baseIteratee from './_baseIteratee.js';
|
||||
import basePickBy from './_basePickBy.js';
|
||||
import negate from './negate.js';
|
||||
import pickBy from './pickBy.js';
|
||||
|
||||
/**
|
||||
* The opposite of `_.pickBy`; this method creates an object composed of
|
||||
@@ -12,8 +13,7 @@ import basePickBy from './_basePickBy.js';
|
||||
* @since 4.0.0
|
||||
* @category Object
|
||||
* @param {Object} object The source object.
|
||||
* @param {Array|Function|Object|string} [predicate=_.identity]
|
||||
* The function invoked per property.
|
||||
* @param {Function} [predicate=_.identity] The function invoked per property.
|
||||
* @returns {Object} Returns the new object.
|
||||
* @example
|
||||
*
|
||||
@@ -23,10 +23,7 @@ import basePickBy from './_basePickBy.js';
|
||||
* // => { 'b': '2' }
|
||||
*/
|
||||
function omitBy(object, predicate) {
|
||||
predicate = baseIteratee(predicate);
|
||||
return basePickBy(object, function(value, key) {
|
||||
return !predicate(value, key);
|
||||
});
|
||||
return pickBy(object, negate(baseIteratee(predicate)));
|
||||
}
|
||||
|
||||
export default omitBy;
|
||||
|
||||
Reference in New Issue
Block a user