summaryrefslogtreecommitdiff
path: root/packages/idb-bridge/src/util
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-02-16 10:31:55 +0100
committerFlorian Dold <florian@dold.me>2021-02-16 13:47:00 +0100
commitd1f00aeaa26af6835ea3f47ac280b1e67d672fa2 (patch)
tree9a5a364f8a5eb1e038bca936d621c015dab53304 /packages/idb-bridge/src/util
parentd384bd5c62198f1160119e60776350109a8ca7d3 (diff)
downloadwallet-core-d1f00aeaa26af6835ea3f47ac280b1e67d672fa2.tar.gz
wallet-core-d1f00aeaa26af6835ea3f47ac280b1e67d672fa2.tar.bz2
wallet-core-d1f00aeaa26af6835ea3f47ac280b1e67d672fa2.zip
get IDB tests to pass again, add new one
Diffstat (limited to 'packages/idb-bridge/src/util')
-rw-r--r--packages/idb-bridge/src/util/FakeEventTarget.ts15
-rw-r--r--packages/idb-bridge/src/util/validateKeyPath.ts2
2 files changed, 9 insertions, 8 deletions
diff --git a/packages/idb-bridge/src/util/FakeEventTarget.ts b/packages/idb-bridge/src/util/FakeEventTarget.ts
index d2f46c98f..95489b4ac 100644
--- a/packages/idb-bridge/src/util/FakeEventTarget.ts
+++ b/packages/idb-bridge/src/util/FakeEventTarget.ts
@@ -97,13 +97,14 @@ abstract class FakeEventTarget implements EventTarget {
public readonly listeners: Listener[] = [];
// These will be overridden in individual subclasses and made not readonly
- public readonly onabort: EventListener | null | undefined;
- public readonly onblocked: EventListener | null | undefined;
- public readonly oncomplete: EventListener | null | undefined;
- public readonly onerror: EventListener | null | undefined;
- public readonly onsuccess: EventListener | null | undefined;
- public readonly onupgradeneeded: EventListener | null | undefined;
- public readonly onversionchange: EventListener | null | undefined;
+ public readonly onabort: EventListener | null = null;
+ public readonly onblocked: EventListener | null = null;
+ public readonly oncomplete: EventListener | null = null;
+ public readonly onerror: EventListener | null = null;
+ public readonly onsuccess: EventListener | null = null;
+ public readonly onclose: EventListener | null = null;
+ public readonly onupgradeneeded: EventListener | null = null;
+ public readonly onversionchange: EventListener | null = null;
static enableTracing: boolean = false;
diff --git a/packages/idb-bridge/src/util/validateKeyPath.ts b/packages/idb-bridge/src/util/validateKeyPath.ts
index 8057172df..2beb3c468 100644
--- a/packages/idb-bridge/src/util/validateKeyPath.ts
+++ b/packages/idb-bridge/src/util/validateKeyPath.ts
@@ -17,7 +17,7 @@
import { IDBKeyPath } from "../idbtypes";
// http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-valid-key-path
-const validateKeyPath = (keyPath: IDBKeyPath, parent?: "array" | "string") => {
+const validateKeyPath = (keyPath: IDBKeyPath | IDBKeyPath[], parent?: "array" | "string") => {
// This doesn't make sense to me based on the spec, but it is needed to pass the W3C KeyPath tests (see same
// comment in extractKey)
let myKeyPath: IDBKeyPath | IDBKeyPath[] = keyPath;