Skip to content

Commit 63c9c04

Browse files
author
ogmatrix
committed
fix: fixed non null assertion
1 parent 8ce8be1 commit 63c9c04

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/indexer/store.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,9 +1018,12 @@ export class DocumentStore {
10181018
let normA = 0;
10191019
let normB = 0;
10201020
for (let i = 0; i < a.length; i++) {
1021-
dotProduct += a[i] * b[i];
1022-
normA += a[i] * a[i];
1023-
normB += b[i] * b[i];
1021+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1022+
dotProduct += a[i]! * b[i]!;
1023+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1024+
normA += a[i]! * a[i]!;
1025+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1026+
normB += b[i]! * b[i]!;
10241027
}
10251028
return dotProduct / (Math.sqrt(normA) * Math.sqrt(normB));
10261029
}

0 commit comments

Comments
 (0)