react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / js-yaml / node_modules / argparse / node_modules / lodash / object / findLastKey.js
80742 viewsvar baseForOwnRight = require('../internal/baseForOwnRight'),1createFindKey = require('../internal/createFindKey');23/**4* This method is like `_.findKey` except that it iterates over elements of5* a collection in the opposite order.6*7* If a property name is provided for `predicate` the created `_.property`8* style callback returns the property value of the given element.9*10* If a value is also provided for `thisArg` the created `_.matchesProperty`11* style callback returns `true` for elements that have a matching property12* value, else `false`.13*14* If an object is provided for `predicate` the created `_.matches` style15* callback returns `true` for elements that have the properties of the given16* object, else `false`.17*18* @static19* @memberOf _20* @category Object21* @param {Object} object The object to search.22* @param {Function|Object|string} [predicate=_.identity] The function invoked23* per iteration.24* @param {*} [thisArg] The `this` binding of `predicate`.25* @returns {string|undefined} Returns the key of the matched element, else `undefined`.26* @example27*28* var users = {29* 'barney': { 'age': 36, 'active': true },30* 'fred': { 'age': 40, 'active': false },31* 'pebbles': { 'age': 1, 'active': true }32* };33*34* _.findLastKey(users, function(chr) {35* return chr.age < 40;36* });37* // => returns `pebbles` assuming `_.findKey` returns `barney`38*39* // using the `_.matches` callback shorthand40* _.findLastKey(users, { 'age': 36, 'active': true });41* // => 'barney'42*43* // using the `_.matchesProperty` callback shorthand44* _.findLastKey(users, 'active', false);45* // => 'fred'46*47* // using the `_.property` callback shorthand48* _.findLastKey(users, 'active');49* // => 'pebbles'50*/51var findLastKey = createFindKey(baseForOwnRight);5253module.exports = findLastKey;545556