Skip to content

Commit c6254ed

Browse files
committed
fix: resolve TypeScript errors in delta.ts
- Replace fsPromises.mkdir with sync mkdirSync - Cast nodeType to ChunkType to fix type error - Import mkdirSync and ChunkType
1 parent a2708a4 commit c6254ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/indexer/delta.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as path from "path";
2-
import { existsSync, readFileSync, rmSync } from "fs";
2+
import { existsSync, readFileSync, rmSync, mkdirSync } from "fs";
33

4-
import { Database, VectorStore, InvertedIndex, ChunkData } from "../native/index.js";
4+
import { Database, VectorStore, InvertedIndex, ChunkData, ChunkType } from "../native/index.js";
55

66
export interface DeltaIndexes {
77
vectorStore: VectorStore;
@@ -25,7 +25,7 @@ export async function buildDeltaIndexes(
2525
const delta = database.getBranchDelta(branch, baseBranch);
2626

2727
const deltaPath = path.join(indexPath, `delta-${sanitizeBranchName(branch)}`);
28-
await fsPromises.mkdir(deltaPath, { recursive: true });
28+
mkdirSync(deltaPath, { recursive: true });
2929

3030
const vectorStorePath = path.join(deltaPath, "vectors");
3131
const vectorStore = new VectorStore(vectorStorePath, dimensions);
@@ -45,7 +45,7 @@ export async function buildDeltaIndexes(
4545
filePath: chunk.filePath,
4646
startLine: chunk.startLine,
4747
endLine: chunk.endLine,
48-
chunkType: chunk.nodeType || "other",
48+
chunkType: (chunk.nodeType || "other") as ChunkType,
4949
name: chunk.name,
5050
language: chunk.language,
5151
hash: chunk.contentHash,

0 commit comments

Comments
 (0)