mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
* 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
26 lines
502 B
TypeScript
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,
|
|
});
|
|
}
|