Skip to content

Commit 9d344cb

Browse files
committed
chore: lint
1 parent f5ab2f9 commit 9d344cb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/commands/status.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ function countDocs(packageName: string, version?: string): number {
5050
return count
5151
}
5252

53-
function countEmbeddings(packageName: string, version?: string): number | null {
53+
async function countEmbeddings(packageName: string, version?: string): Promise<number | null> {
5454
if (!version)
5555
return null
5656
const dbPath = getPackageDbPath(packageName, version)
5757
if (!existsSync(dbPath))
5858
return null
5959
try {
60-
const { DatabaseSync } = require('node:sqlite')
60+
const { DatabaseSync } = await import('node:sqlite')
6161
const db = new DatabaseSync(dbPath, { open: true, readOnly: true })
6262
const row = db.prepare('SELECT count(*) as cnt FROM vector_metadata').get() as { cnt: number } | undefined
6363
db.close()
@@ -215,7 +215,7 @@ export function statusCommand(opts: StatusOptions = {}): void {
215215
if (docs > 0)
216216
meta.push(`${docs} docs`)
217217

218-
const embeddings = countEmbeddings(pkgName, info.version)
218+
const embeddings = await countEmbeddings(pkgName, info.version)
219219
if (embeddings !== null)
220220
meta.push(`${embeddings} chunks`)
221221

0 commit comments

Comments
 (0)