mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-27 22:16:14 +00:00
feat: support binary vector and IVF_FLAT in TypeScript (#2221)
resolve #2218 --------- Signed-off-by: BubbleCal <bubble-cal@outlook.com>
This commit is contained in:
@@ -35,6 +35,16 @@ export function toSQL(value: IntoSql): string {
|
||||
}
|
||||
}
|
||||
|
||||
export function packBits(data: Array<number>): Array<number> {
|
||||
const packed = Array(data.length >> 3).fill(0);
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const byte = i >> 3;
|
||||
const bit = i & 7;
|
||||
packed[byte] |= data[i] << bit;
|
||||
}
|
||||
return packed;
|
||||
}
|
||||
|
||||
export class TTLCache {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
private readonly cache: Map<string, { value: any; expires: number }>;
|
||||
|
||||
Reference in New Issue
Block a user