Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

orderByBTree.ts

20 lines589 Bytes

1import { orderByWithFractionalIndexBase } from './orderBy.js'
2import { topKWithFractionalIndexBTree } from './topKWithFractionalIndexBTree.js'
3import type { KeyValue } from '../types.js'
4import type { OrderByOptions } from './orderBy.js'
5​
6export function orderByWithFractionalIndexBTree<
7 T extends KeyValue<unknown, unknown>,
8 Ve = unknown,
9>(
10 valueExtractor: (
11 value: T extends KeyValue<unknown, infer V> ? V : never,
12 ) => Ve,
13 options?: OrderByOptions<Ve>,
14) {
15 return orderByWithFractionalIndexBase(
16 topKWithFractionalIndexBTree,
17 valueExtractor,
18 options,
19 )