From f34ee53a1220551ef93b39b916e0b455ae342bf0 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 31 Aug 2021 15:14:21 -0700 Subject: [PATCH] Avoid casting to any when a more specific type is possible --- src/matrix/storage/idb/stores/RoomMemberStore.ts | 2 +- src/matrix/storage/idb/stores/TimelineFragmentStore.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matrix/storage/idb/stores/RoomMemberStore.ts b/src/matrix/storage/idb/stores/RoomMemberStore.ts index e389bb77..00cf607f 100644 --- a/src/matrix/storage/idb/stores/RoomMemberStore.ts +++ b/src/matrix/storage/idb/stores/RoomMemberStore.ts @@ -52,7 +52,7 @@ export class RoomMemberStore { set(member: MemberData): void { // Object.assign would be more typesafe, but small objects - (member as any).key = encodeKey(member.roomId, member.userId); + (member as MemberStorageEntry).key = encodeKey(member.roomId, member.userId); this._roomMembersStore.put(member as MemberStorageEntry); } diff --git a/src/matrix/storage/idb/stores/TimelineFragmentStore.ts b/src/matrix/storage/idb/stores/TimelineFragmentStore.ts index 54b66489..813fc3f3 100644 --- a/src/matrix/storage/idb/stores/TimelineFragmentStore.ts +++ b/src/matrix/storage/idb/stores/TimelineFragmentStore.ts @@ -75,7 +75,7 @@ export class TimelineFragmentStore { // depends if we want to do anything smart with fragment ids, // like give them meaning depending on range. not for now probably ... add(fragment: Fragment): void { - (fragment as any).key = encodeKey(fragment.roomId, fragment.id); + (fragment as FragmentEntry).key = encodeKey(fragment.roomId, fragment.id); this._store.add(fragment as FragmentEntry); }