fix(kuzu): remove duplicate ftsLoaded declaration that broke typecheck

The module-level `let ftsLoaded` was declared twice (line 19 and 679),
causing TS2451. Removed the duplicate and cleaned up redundant
assignments in loadFTSExtension.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
abhigyanpatwari 2026-02-27 11:31:07 +05:30
parent a8b3c6b23f
commit 5c3a32d0c6

View file

@ -674,22 +674,18 @@ export const getEmbeddingTableName = (): string => EMBEDDING_TABLE_NAME;
/**
* Load the FTS extension (required before using FTS functions).
* Safe to call multiple times — tracks loaded state.
* Safe to call multiple times — tracks loaded state via module-level ftsLoaded.
*/
let ftsLoaded = false;
export const loadFTSExtension = async (): Promise<void> => {
if (ftsLoaded) return;
if (!conn) {
throw new Error('KuzuDB not initialized. Call initKuzu first.');
}
if (ftsLoaded) return;
try {
await conn.query('INSTALL fts');
await conn.query('LOAD EXTENSION fts');
ftsLoaded = true;
} catch {
// Extension may already be loaded
ftsLoaded = true;
}
ftsLoaded = true;
};