Rinser/node_modules/lodash/internal/createFindKey.js

19 lines
524 B
JavaScript
Raw Normal View History

2015-07-20 13:42:07 +00:00
var baseCallback = require('./baseCallback'),
baseFind = require('./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);
};
}
module.exports = createFindKey;