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

Function getYjsValue

packages/core/src/index.ts:81–91  ·  view source on GitHub ↗
(object: any)

Source from the content-addressed store, hash-verified

79 * @returns the Yjs value underneath. This can be a Y.Doc, Y.Array, Y.Map or other Y-type based on the value passed in
80 */
81export function getYjsValue(object: any): Y.Doc | Y.AbstractType<any> | undefined {
82 if (typeof object !== "object" || object === null) {
83 return undefined;
84 }
85 const ret = object[INTERNAL_SYMBOL];
86 if (ret) {
87 markRaw(ret);
88 (ret as any).__v_skip = true; // for vue Reactive
89 }
90 return ret;
91}
92
93/**
94 * Check whether two objects represent the same value.

Callers 10

crdt.test.tsFile · 0.90
store.tsFile · 0.90
store.tsFile · 0.90
store.tsFile · 0.90
observeDeepFunction · 0.85
getYjsDocFunction · 0.85
areSameFunction · 0.85
wrapItemsFunction · 0.85
crdtObjectFunction · 0.85
crdtValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected