Avoid unsafe (and error-prone) cast

This commit is contained in:
Danila Fedorin 2021-08-27 09:29:02 -07:00
parent 904a2cbe74
commit 4c4687a05f

View File

@ -35,15 +35,14 @@ class QueryTargetWrapper<T> {
}
get keyPath(): string | string[] {
if ("objectStore" in this._qt) {
return this._qt.objectStore.keyPath;
} else {
return this._qt.keyPath;
}
return this._qtStore.keyPath;
}
get _qtStore(): IDBObjectStore {
return this._qt as IDBObjectStore;
if ("objectStore" in this._qt) {
return this._qt.objectStore;
}
return this._qt;
}
supports(methodName: string): boolean {