Files
lodash/internal/createFindKey.js
John-David Dalton 9724afd7a6 Bump to v3.6.0.
2015-12-16 17:49:07 -08:00

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;
});