Files
Netcatty/domain/convergentSync/record.ts
T
ryan-wong-coder 3af90b6e8f feat(sync): add convergent CRDT core (#2247)
* feat(sync): add convergent CRDT core

* fix(sync): handle setting shape conflicts canonically

* fix(sync): tombstone deleted setting subtrees

* fix(sync): reject unwitnessed version vectors

* fix(sync): harden CRDT convergence invariants

* fix(sync): avoid no-op entity resurrection

* fix(sync): reject retained causal cycles

* fix(sync): ignore unobserved collection deletes

* fix(sync): avoid unchanged setting writes

* fix(sync): resolve entity upsert conflicts

* fix(sync): resolve string entry conflicts

* fix(sync): prove causal register origins

* fix(sync): hide conflicts for deleted entries

* fix(sync): require explicit mutation timestamps
2026-07-16 16:01:27 +08:00

26 lines
502 B
TypeScript

export function createEmptyRecord<T>(): Record<string, T> {
return {};
}
export function getOwnRecordValue<T>(
record: Record<string, T>,
key: string,
): T | undefined {
return Object.prototype.hasOwnProperty.call(record, key)
? record[key]
: undefined;
}
export function setOwnRecordValue<T>(
record: Record<string, T>,
key: string,
value: T,
): void {
Object.defineProperty(record, key, {
configurable: true,
enumerable: true,
value,
writable: true,
});
}