source: node_modules/es-toolkit/dist/compat/array/sortedIndexBy.d.ts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 988 bytes
Line 
1import { ValueIteratee } from '../_internal/ValueIteratee.js';
2
3/**
4 * This method is like `sortedIndex` except that it accepts `iteratee`
5 * which is invoked for `value` and each element of `array` to compute their
6 * sort ranking. The iteratee is invoked with one argument: (value).
7 *
8 * @template T
9 * @param {ArrayLike<T> | null | undefined} array - The sorted array to inspect.
10 * @param {T} value - The value to evaluate.
11 * @param {ValueIteratee<T>} [iteratee] - The iteratee invoked per element.
12 * @returns {number} Returns the index at which `value` should be inserted into `array`.
13 *
14 * @example
15 * const dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
16 * sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
17 * // => 1
18 *
19 * @example
20 * sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
21 * // => 0
22 */
23declare function sortedIndexBy<T>(array: ArrayLike<T> | null | undefined, value: T, iteratee?: ValueIteratee<T>): number;
24
25export { sortedIndexBy };
Note: See TracBrowser for help on using the repository browser.