diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-03 13:00:48 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-03 13:01:05 +0530 |
commit | ffd2a62c3f7df94365980302fef3bc3376b48182 (patch) | |
tree | 270af6f16b4cc7f5da2afdba55c8bc9dbea5eca5 /packages/idb-bridge/src/BridgeIDBDatabase.ts | |
parent | aa481e42675fb7c4dcbbeec0ba1c61e1953b9596 (diff) | |
download | wallet-core-ffd2a62c3f7df94365980302fef3bc3376b48182.tar.xz |
modularize repo, use pnpm, improve typechecking
Diffstat (limited to 'packages/idb-bridge/src/BridgeIDBDatabase.ts')
-rw-r--r-- | packages/idb-bridge/src/BridgeIDBDatabase.ts | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/packages/idb-bridge/src/BridgeIDBDatabase.ts b/packages/idb-bridge/src/BridgeIDBDatabase.ts index bc2e8acca..a22ad5400 100644 --- a/packages/idb-bridge/src/BridgeIDBDatabase.ts +++ b/packages/idb-bridge/src/BridgeIDBDatabase.ts @@ -14,7 +14,7 @@ * permissions and limitations under the License. */ -import BridgeIDBTransaction from "./BridgeIDBTransaction"; +import { BridgeIDBTransaction } from "./BridgeIDBTransaction"; import { ConstraintError, InvalidAccessError, @@ -61,9 +61,8 @@ const confirmActiveVersionchangeTransaction = (database: BridgeIDBDatabase) => { return transaction; }; - // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#database-interface -class BridgeIDBDatabase extends FakeEventTarget { +export class BridgeIDBDatabase extends FakeEventTarget { _closePending = false; _closed = false; _runningVersionchangeTransaction = false; @@ -152,7 +151,12 @@ class BridgeIDBDatabase extends FakeEventTarget { throw new InvalidAccessError(); } - transaction._backend.createObjectStore(backendTx, name, keyPath, autoIncrement); + transaction._backend.createObjectStore( + backendTx, + name, + keyPath, + autoIncrement, + ); this._schema = this._backend.getSchema(this._backendConnection); @@ -212,7 +216,12 @@ class BridgeIDBDatabase extends FakeEventTarget { } } - const tx = new BridgeIDBTransaction(storeNames, mode, this, backendTransaction); + const tx = new BridgeIDBTransaction( + storeNames, + mode, + this, + backendTransaction, + ); this._transactions.push(tx); queueTask(() => tx._start()); return tx; @@ -236,5 +245,3 @@ class BridgeIDBDatabase extends FakeEventTarget { return "[object IDBDatabase]"; } } - -export default BridgeIDBDatabase; |