Skip to content

mergeSlugRegistry

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/apps/api/src/docs-repo/sidecar.ts

Merge the current served set into the existing registry and return the deterministic string.

For each page (keyed by docUuid): upsert slug/scope/lang/kgEntityId. If the slug CHANGED from the stored one, append the old slug to previousSlugs (dedup, keep order). Entries for docUuids no longer served are RETAINED — the ledger is an identity history, not a mirror of the live set (a page can be unpublished then republished under the same identity, and rename history must survive a doc dropping out of the served set for a version).

Signature

ts
function mergeSlugRegistry(existingJson: string | null | undefined, pages: PageIdentity[]): string

Parameters

NameType
existingJson`string
pagesPageIdentity[]

Returns: string

Was this page helpful?

Download as PDF