56e07670d6480ea86eb93983c38b60824aa901c47eae5fcca89b26bc238cbe4b0d044c1fee15b7e8254bc05d152df9b8f9364af113c3dd592a94de562f7a7a 487 B

123456789101112131415161718192021
  1. var eq = require('./eq');
  2. /**
  3. * Gets the index at which the `key` is found in `array` of key-value pairs.
  4. *
  5. * @private
  6. * @param {Array} array The array to inspect.
  7. * @param {*} key The key to search for.
  8. * @returns {number} Returns the index of the matched value, else `-1`.
  9. */
  10. function assocIndexOf(array, key) {
  11. var length = array.length;
  12. while (length--) {
  13. if (eq(array[length][0], key)) {
  14. return length;
  15. }
  16. }
  17. return -1;
  18. }
  19. module.exports = assocIndexOf;