MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / buildEditHistoryEntry

Function buildEditHistoryEntry

packages/studio/src/utils/editHistory.ts:84–105  ·  view source on GitHub ↗
(input: BuildEditHistoryEntryInput)

Source from the content-addressed store, hash-verified

82}
83
84export function buildEditHistoryEntry(input: BuildEditHistoryEntryInput): EditHistoryEntry {
85 const files: Record<string, EditHistoryFileSnapshot> = {};
86 for (const [path, snapshot] of Object.entries(input.files)) {
87 if (snapshot.before === snapshot.after) continue;
88 files[path] = {
89 before: snapshot.before,
90 after: snapshot.after,
91 beforeHash: hashEditHistoryContent(snapshot.before),
92 afterHash: hashEditHistoryContent(snapshot.after),
93 };
94 }
95
96 return {
97 id: input.id,
98 projectId: input.projectId,
99 label: input.label,
100 kind: input.kind ?? "manual",
101 coalesceKey: input.coalesceKey,
102 createdAt: input.now,
103 files,
104 };
105}
106
107export function pushEditHistoryEntry(
108 state: EditHistoryState,

Callers 3

recordEditFunction · 0.90

Calls 2

hashEditHistoryContentFunction · 0.85
entriesMethod · 0.80

Tested by

no test coverage detected