MCPcopy Create free account
hub / github.com/hashintel/hash / isEntityOrgEntity

Function isEntityOrgEntity

apps/hash-frontend/src/lib/user-and-org.ts:152–159  ·  view source on GitHub ↗
(
  entity: Entity,
)

Source from the content-addressed store, hash-verified

150};
151
152export const isEntityOrgEntity = (
153 entity: Entity,
154): entity is Entity<Organization> =>
155 entity.metadata.entityTypeIds.some(
156 (entityTypeId) =>
157 extractBaseUrl(entityTypeId) ===
158 systemEntityTypes.organization.entityTypeBaseUrl,
159 );
160
161/**
162 * Constructs a simplified org object from a subgraph.

Callers 4

useOrgsFunction · 0.90
useOrgsWithLinksFunction · 0.90
useUserOrOrgFunction · 0.90
constructUserFunction · 0.85

Calls 1

extractBaseUrlFunction · 0.90

Tested by

no test coverage detected