Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
fix: update interface-store to 5.x.x (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain authored Mar 23, 2023
1 parent 49aa042 commit 4c918fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@
},
"dependencies": {
"idb": "^7.1.1",
"interface-datastore": "^8.0.0",
"interface-datastore": "^8.1.2",
"it-filter": "^2.0.1",
"it-sort": "^2.0.1"
},
"devDependencies": {
"aegir": "^38.1.7",
"datastore-core": "^9.0.2",
"interface-datastore-tests": "^4.0.0"
"datastore-core": "^9.0.4",
"interface-datastore-tests": "^5.0.0"
}
}
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ export class IDBDatastore extends BaseDatastore {
this.db?.close()
}

async put (key: Key, val: Uint8Array): Promise<void> {
async put (key: Key, val: Uint8Array): Promise<Key> {
if (this.db == null) {
throw new Error('Datastore needs to be opened.')
}

try {
await this.db.put(this.location, val, key.toString())

return key
} catch (err: any) {
throw Errors.dbWriteFailedError(err)
}
Expand Down
2 changes: 1 addition & 1 deletion test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('IndexedDB Datastore', function () {
datastore: three
}
])
await d.open()

return d
},
teardown () {
Expand Down

0 comments on commit 4c918fc

Please sign in to comment.