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 {
// 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);
}

View file

@ -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);
}