MCPcopy
hub / github.com/YousefED/SyncedStore / areSame

Function areSame

packages/core/src/index.ts:102–116  ·  view source on GitHub ↗
(objectA: any, objectB: any)

Source from the content-addressed store, hash-verified

100 * @returns true if they represent the same object, false otherwise
101 */
102export function areSame(objectA: any, objectB: any) {
103 if (objectA === objectB) {
104 return true;
105 }
106 if (typeof objectA === "object" && typeof objectB === "object") {
107 const internalA = getYjsValue(objectA);
108 const internalB = getYjsValue(objectB);
109 if (!internalA || !internalB) {
110 // one of them doesn't have an internal value
111 return false;
112 }
113 return internalA === internalB;
114 }
115 return false;
116}
117
118/**
119 * Create a SyncedStore store

Callers 1

arrayImplementationFunction · 0.85

Calls 1

getYjsValueFunction · 0.85

Tested by

no test coverage detected