forked from mystiq/hydrogen-web
Avoid unsafe (and error-prone) cast
This commit is contained in:
parent
904a2cbe74
commit
4c4687a05f
1 changed files with 5 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue