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

hash-collision-support.ts

15 lines811 Bytes

1// Shared by the hash identity oracle and its ordinary tests: a second module
2// copy whose initialization draws are all equal, so every type marker has the
3// same hash number. Its top-K batch is loaded right after it, so it binds to
4// that copy.
5import { captureHashSession } from './hash-session'
6​
7// A second module copy whose initialization draws are all equal. Every
8// random constant, including every type marker, gets the same number, so a
9// design that tells types apart by marker number fails here.
10const nativeTape = (await captureHashSession()).tape
11export const colliding = await captureHashSession(nativeTape.map(() => 0.5))
12// Loaded right after the colliding module, so it binds to that copy.
13export const { topKBatch: collidingTopKBatch } = await import(
14 `../src/operators/topKState.js`