Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / createFindIndex.js
1 var baseCallback = require('./baseCallback'),
2     baseFindIndex = require('./baseFindIndex');
3
4 /**
5  * Creates a `_.findIndex` or `_.findLastIndex` function.
6  *
7  * @private
8  * @param {boolean} [fromRight] Specify iterating from right to left.
9  * @returns {Function} Returns the new find function.
10  */
11 function createFindIndex(fromRight) {
12   return function(array, predicate, thisArg) {
13     if (!(array && array.length)) {
14       return -1;
15     }
16     predicate = baseCallback(predicate, thisArg, 3);
17     return baseFindIndex(array, predicate, fromRight);
18   };
19 }
20
21 module.exports = createFindIndex;