diff --git a/lib/types/minimally-encoded-thread-permissions-types.js b/lib/types/minimally-encoded-thread-permissions-types.js --- a/lib/types/minimally-encoded-thread-permissions-types.js +++ b/lib/types/minimally-encoded-thread-permissions-types.js @@ -8,8 +8,8 @@ LegacyRawThreadInfo, LegacyRelativeMemberInfo, LegacyRoleInfo, - ThreadCurrentUserInfo, LegacyThreadInfo, + ThreadCurrentUserInfo, } from './thread-types.js'; import { decodeThreadRolePermissionsBitmaskArray, @@ -192,36 +192,6 @@ +currentUser: MinimallyEncodedThreadCurrentUserInfo, }>; -const minimallyEncodeThreadInfo = ( - threadInfo: LegacyThreadInfo, -): ThreadInfo => { - invariant( - !('minimallyEncoded' in threadInfo), - 'threadInfo is already minimally encoded.', - ); - const { members, roles, currentUser, ...rest } = threadInfo; - return { - ...rest, - minimallyEncoded: true, - members: members.map(minimallyEncodeRelativeMemberInfo), - roles: _mapValues(minimallyEncodeRoleInfo)(roles), - currentUser: minimallyEncodeThreadCurrentUserInfo(currentUser), - }; -}; - -const decodeMinimallyEncodedThreadInfo = ( - minimallyEncodedThreadInfo: ThreadInfo, -): LegacyThreadInfo => { - const { minimallyEncoded, members, roles, currentUser, ...rest } = - minimallyEncodedThreadInfo; - return { - ...rest, - members: members.map(decodeMinimallyEncodedRelativeMemberInfo), - roles: _mapValues(decodeMinimallyEncodedRoleInfo)(roles), - currentUser: decodeMinimallyEncodedThreadCurrentUserInfo(currentUser), - }; -}; - export type ResolvedThreadInfo = $ReadOnly<{ ...ThreadInfo, +uiName: string, @@ -238,6 +208,4 @@ decodeMinimallyEncodedRawThreadInfo, minimallyEncodeRelativeMemberInfo, decodeMinimallyEncodedRelativeMemberInfo, - minimallyEncodeThreadInfo, - decodeMinimallyEncodedThreadInfo, };