MCPcopy Create free account
hub / github.com/clientdb/clientdb / pickBeforeFromChanges

Function pickBeforeFromChanges

core/utils/changes.ts:7–17  ·  view source on GitHub ↗
(changes: Changes<T>)

Source from the content-addressed store, hash-verified

5};
6
7export function pickBeforeFromChanges<T>(changes: Changes<T>): Partial<T> {
8 const before: Partial<T> = {};
9
10 for (const key in changes) {
11 if (changes.hasOwnProperty(key)) {
12 before[key] = changes[key]![0];
13 }
14 }
15
16 return before;
17}
18
19export function pickAfterFromChanges<T>(changes: Changes<T>): Partial<T> {
20 const after: Partial<T> = {};

Callers 2

rollbackFunction · 0.90
undoEntityChangeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected