Skip to content

Commit

Permalink
Fixed indexeddbstorageprovider
Browse files Browse the repository at this point in the history
  • Loading branch information
ansi-code committed Apr 19, 2024
1 parent 89f578b commit 2dc8003
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ipdw",
"version": "2.0.2",
"version": "2.0.3",
"author": "Andrea Silvi",
"type": "module",
"main": "./dist/node/index.js",
Expand Down
3 changes: 2 additions & 1 deletion src/core/storage/indexeddb.storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export class IndexedDBStorageProvider implements StorageProvider {
}

public async get(key: string): Promise<Uint8Array | undefined> {
return new Uint8Array((await IndexedDBStorageProvider.IDBRequestPromisify(this.database.transaction(this.basePath, "readonly").objectStore(this.basePath).get(key))).value);
const res = await IndexedDBStorageProvider.IDBRequestPromisify(this.database.transaction(this.basePath, "readonly").objectStore(this.basePath).get(key));
return res ? new Uint8Array(res.value) : undefined;
}

public async ls(): Promise<string[]> {
Expand Down

0 comments on commit 2dc8003

Please sign in to comment.