X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgrunt-uncss%2Fnode_modules%2Flodash%2F_baseIndexOfWith.js;fp=node_modules%2Fgrunt-uncss%2Fnode_modules%2Flodash%2F_baseIndexOfWith.js;h=f815fe0ddae3bf27b7c2d51193dd211f73f79830;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/grunt-uncss/node_modules/lodash/_baseIndexOfWith.js b/node_modules/grunt-uncss/node_modules/lodash/_baseIndexOfWith.js new file mode 100644 index 000000000..f815fe0dd --- /dev/null +++ b/node_modules/grunt-uncss/node_modules/lodash/_baseIndexOfWith.js @@ -0,0 +1,23 @@ +/** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOfWith;