MergePreservationRegions
@aurorajs.dev/catalyst-cli / generator/engine/lock-file / mergePreservationRegions
Function: mergePreservationRegions()
Section titled “Function: mergePreservationRegions()”mergePreservationRegions(
newContent,existingContent,priorHashes?):MergeResult
Defined in: generator/engine/lock-file.ts:225
Merge preservation regions: per-region decision based on priorHashes.
- If the existing body hash matches priorHashes[name] → use newContent body (user did not modify → template improvement propagates).
- Otherwise → preserve existingContent body byte-for-byte.
- If priorHashes is undefined → preserve all (fallback, legacy lockfile).
- Regions only in newContent keep their new body.
- Regions only in existingContent are dropped (body lost).
Parameters
Section titled “Parameters”newContent
Section titled “newContent”string
existingContent
Section titled “existingContent”string
priorHashes?
Section titled “priorHashes?”Record<string, string>