main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
852 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import baseIteratee from './_baseIteratee.js';
|
---|
| 2 | import negate from './negate.js';
|
---|
| 3 | import pickBy from './pickBy.js';
|
---|
| 4 |
|
---|
| 5 | /**
|
---|
| 6 | * The opposite of `_.pickBy`; this method creates an object composed of
|
---|
| 7 | * the own and inherited enumerable string keyed properties of `object` that
|
---|
| 8 | * `predicate` doesn't return truthy for. The predicate is invoked with two
|
---|
| 9 | * arguments: (value, key).
|
---|
| 10 | *
|
---|
| 11 | * @static
|
---|
| 12 | * @memberOf _
|
---|
| 13 | * @since 4.0.0
|
---|
| 14 | * @category Object
|
---|
| 15 | * @param {Object} object The source object.
|
---|
| 16 | * @param {Function} [predicate=_.identity] The function invoked per property.
|
---|
| 17 | * @returns {Object} Returns the new object.
|
---|
| 18 | * @example
|
---|
| 19 | *
|
---|
| 20 | * var object = { 'a': 1, 'b': '2', 'c': 3 };
|
---|
| 21 | *
|
---|
| 22 | * _.omitBy(object, _.isNumber);
|
---|
| 23 | * // => { 'b': '2' }
|
---|
| 24 | */
|
---|
| 25 | function omitBy(object, predicate) {
|
---|
| 26 | return pickBy(object, negate(baseIteratee(predicate)));
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | export default omitBy;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.