Kind: Function
Source: atloria-monorepo/apps/api/src/docs-repo/sidecar.ts
Parse an existing registry file; tolerate absent/corrupt input by starting empty. "Corrupt"
covers BOTH syntactic (bad JSON) AND structural (valid JSON, wrong shape) corruption: every
entry is COERCED to the expected shape so a hand-edited/partial-write/migration-renamed file
with, say, a missing previousSlugs can never make a later [...entry.previousSlugs] throw
and wedge the committer on every reconcile. A malformed entry is repaired, not trusted.
Signature
tsfunction parseSlugRegistry(json: string | null | undefined): SlugRegistry
Parameters
| Name | Type |
|---|---|
json | `string |
Returns: SlugRegistry
Was this page helpful?