mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
19 lines
538 B
JavaScript
19 lines
538 B
JavaScript
define(['./baseCallback', './baseFind'], function(baseCallback, baseFind) {
|
|
|
|
/**
|
|
* Creates a `_.findKey` or `_.findLastKey` function.
|
|
*
|
|
* @private
|
|
* @param {Function} objectFunc The function to iterate over an object.
|
|
* @returns {Function} Returns the new find function.
|
|
*/
|
|
function createFindKey(objectFunc) {
|
|
return function(object, predicate, thisArg) {
|
|
predicate = baseCallback(predicate, thisArg, 3);
|
|
return baseFind(object, predicate, objectFunc, true);
|
|
};
|
|
}
|
|
|
|
return createFindKey;
|
|
});
|