UNPKG

@extra-array/bsearch-any

Version:

Binary searches value in sorted array.

12 lines 451 B
import type { compareFn, mapFn } from './_types'; /** * Binary searches value in sorted array. * @param x an array (sorted) * @param v search value * @param fc compare function (a, b) * @param fm map function (v, i, x) * @returns index of value | ~(index of closest value) */ declare function bsearchAny<T, U = T>(x: T[], v: T, fc?: compareFn<T | U>, fm?: mapFn<T, T | U>): number; export default bsearchAny; //# sourceMappingURL=index.d.ts.map