Skip to content

buildEntityPageIndexes

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/libs/parser-core/src/techdocs/entity-page.ts

Build the shared indexes renderEntityPage can consume, ONCE, for callers that render many pages from the same graph. Turns per-page O(entities+relationships) work into O(deg) lookups.

Signature

ts
function buildEntityPageIndexes(entities: Entity[], relationships: Relationship[]): {
  nameResolver: (id: string) => string;
  outgoingBySource: Map<string, Relationship[]>;
  incomingByTarget: Map<string, Relationship[]>;
}

Parameters

NameType
entitiesEntity[]
relationshipsRelationship[]

Returns: { nameResolver: (id: string) => string; outgoingBySource: Map<string, Relationship[]>; incomingByTarget: Map<string, Relationship[]>; }

Was this page helpful?

Download as PDF