diff --git a/lib/permissions/dm-permissions.js b/lib/permissions/dm-permissions.js --- a/lib/permissions/dm-permissions.js +++ b/lib/permissions/dm-permissions.js @@ -1,7 +1,5 @@ // @flow -import invariant from 'invariant'; - import { OPEN_CHILD, OPEN_DESCENDANT } from './prefixes.js'; import { type ThreadRolePermissionsBlob, @@ -9,14 +7,12 @@ } from '../types/thread-permission-types.js'; import { type ThickThreadType, - threadTypeIsThick, threadTypes, } from '../types/thread-types-enum.js'; function getThickThreadRolePermissionsBlob( threadType: ThickThreadType, ): ThreadRolePermissionsBlob { - invariant(threadTypeIsThick(threadType), 'ThreadType should be thick'); const openDescendantKnowOf = OPEN_DESCENDANT + threadPermissions.KNOW_OF; const openDescendantVisible = OPEN_DESCENDANT + threadPermissions.VISIBLE; const openChildJoinThread = OPEN_CHILD + threadPermissions.JOIN_THREAD; diff --git a/lib/types/thread-types-enum.js b/lib/types/thread-types-enum.js --- a/lib/types/thread-types-enum.js +++ b/lib/types/thread-types-enum.js @@ -75,11 +75,6 @@ ...thickThreadTypes, }); -const thickThreadTypesSet = new Set(Object.values(thickThreadTypes)); -export function threadTypeIsThick(threadType: ThreadType): boolean { - return thickThreadTypesSet.has(threadType); -} - export function assertThinThreadType(threadType: number): ThinThreadType { invariant( threadType === 3 ||