Skip to content

Commit

Permalink
FIx type issue for .all()
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-dev-pro committed Aug 28, 2023
1 parent a64c0b9 commit 133cc43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ type Row = {

const _rows2obj = <T>(rows: Row[]) => {
try {
return rows.reduce<Record<string, any>>((acc, row) => {
return rows.reduce<Record<string, T>>((acc, row) => {
const key = row.key
acc[key] = JSON.parse(row.value) as T
return acc
}, {})
} catch (error) {
console.error(error)
throw new Error("Can't parse value from database")
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bun-kv",
"version": "1.0.0",
"version": "1.0.1",
"description": "Bun simple key-value storage with SQLite",
"main": "index.js",
"repository": {
Expand Down

0 comments on commit 133cc43

Please sign in to comment.