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 @@ -7,11 +7,11 @@ import type { ThreadPermissionsInfo } from './thread-permission-types.js'; import type { ThreadType } from './thread-types-enum.js'; import type { + ClientLegacyRoleInfo, LegacyMemberInfo, LegacyRawThreadInfo, - LegacyThinRawThreadInfo, LegacyThickRawThreadInfo, - ClientLegacyRoleInfo, + LegacyThinRawThreadInfo, LegacyThreadCurrentUserInfo, ThickMemberInfo, } from './thread-types.js'; @@ -114,13 +114,6 @@ { +permissions: string }, >; -function stripPermissionsFromMemberInfo( - memberInfo: MemberInfoWithPermissions, -): MemberInfoSansPermissions { - const { permissions, ...rest } = memberInfo; - return rest; -} - export type MinimallyEncodedThickMemberInfo = $ReadOnly<{ ...ThickMemberInfo, +minimallyEncoded: true, @@ -294,7 +287,6 @@ decodeMinimallyEncodedRoleInfo, minimallyEncodeThreadCurrentUserInfo, decodeMinimallyEncodedThreadCurrentUserInfo, - stripPermissionsFromMemberInfo, minimallyEncodeMemberInfo, decodeMinimallyEncodedMemberInfo, deprecatedMinimallyEncodeRawThreadInfo, diff --git a/lib/utils/member-info-utils.js b/lib/utils/member-info-utils.js new file mode 100644 --- /dev/null +++ b/lib/utils/member-info-utils.js @@ -0,0 +1,15 @@ +// @flow + +import type { + MemberInfoSansPermissions, + MemberInfoWithPermissions, +} from '../types/minimally-encoded-thread-permissions-types.js'; + +function stripPermissionsFromMemberInfo( + memberInfo: MemberInfoWithPermissions, +): MemberInfoSansPermissions { + const { permissions, ...rest } = memberInfo; + return rest; +} + +export { stripPermissionsFromMemberInfo }; diff --git a/lib/types/minimally-encoded-thread-permissions-types.test.js b/lib/utils/member-info-utils.test.js rename from lib/types/minimally-encoded-thread-permissions-types.test.js rename to lib/utils/member-info-utils.test.js --- a/lib/types/minimally-encoded-thread-permissions-types.test.js +++ b/lib/utils/member-info-utils.test.js @@ -1,10 +1,10 @@ // @flow +import { stripPermissionsFromMemberInfo } from './member-info-utils.js'; import type { MemberInfoSansPermissions, MemberInfoWithPermissions, -} from './minimally-encoded-thread-permissions-types.js'; -import { stripPermissionsFromMemberInfo } from './minimally-encoded-thread-permissions-types.js'; +} from '../types/minimally-encoded-thread-permissions-types.js'; describe('stripPermissionsFromMemberInfo', () => { test('should produce valid MemberInfoSansPermissions', () => {