summaryrefslogtreecommitdiff
path: root/alarm/node_modules/lodash/findIndex.js
diff options
context:
space:
mode:
Diffstat (limited to 'alarm/node_modules/lodash/findIndex.js')
-rw-r--r--alarm/node_modules/lodash/findIndex.js55
1 files changed, 0 insertions, 55 deletions
diff --git a/alarm/node_modules/lodash/findIndex.js b/alarm/node_modules/lodash/findIndex.js
deleted file mode 100644
index 4689069..0000000
--- a/alarm/node_modules/lodash/findIndex.js
+++ /dev/null
@@ -1,55 +0,0 @@
-var baseFindIndex = require('./_baseFindIndex'),
- baseIteratee = require('./_baseIteratee'),
- toInteger = require('./toInteger');
-
-/* Built-in method references for those with the same name as other `lodash` methods. */
-var nativeMax = Math.max;
-
-/**
- * This method is like `_.find` except that it returns the index of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.findIndex(users, function(o) { return o.user == 'barney'; });
- * // => 0
- *
- * // The `_.matches` iteratee shorthand.
- * _.findIndex(users, { 'user': 'fred', 'active': false });
- * // => 1
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findIndex(users, ['active', false]);
- * // => 0
- *
- * // The `_.property` iteratee shorthand.
- * _.findIndex(users, 'active');
- * // => 2
- */
-function findIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseFindIndex(array, baseIteratee(predicate, 3), index);
-}
-
-module.exports = findIndex;