Skip to content

MergePreservationRegions

@aurorajs.dev/catalyst-cli


@aurorajs.dev/catalyst-cli / generator/engine/lock-file / 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).

string

string

Record<string, string>

MergeResult