Avoid casting to any when a more specific type is possible

This commit is contained in:
Danila Fedorin 2021-08-31 15:14:21 -07:00
parent bef02d238f
commit f34ee53a12
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ export class RoomMemberStore {
set(member: MemberData): void { set(member: MemberData): void {
// Object.assign would be more typesafe, but small objects // 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); this._roomMembersStore.put(member as MemberStorageEntry);
} }

View File

@ -75,7 +75,7 @@ export class TimelineFragmentStore {
// depends if we want to do anything smart with fragment ids, // depends if we want to do anything smart with fragment ids,
// like give them meaning depending on range. not for now probably ... // like give them meaning depending on range. not for now probably ...
add(fragment: Fragment): void { 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); this._store.add(fragment as FragmentEntry);
} }