MCPcopy
hub / github.com/yjs/yjs / getNextStructTarget

Function getNextStructTarget

src/utils/encoding.js:199–213  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197 return null
198 }
199 const getNextStructTarget = () => {
200 if (clientsStructRefsIds.length === 0) {
201 return null
202 }
203 let nextStructsTarget = /** @type {{i:number,refs:Array<GC|Item>}} */ (clientsStructRefs.clients.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]))
204 while (nextStructsTarget.refs.length === nextStructsTarget.i) {
205 clientsStructRefsIds.pop()
206 if (clientsStructRefsIds.length > 0) {
207 nextStructsTarget = /** @type {{i:number,refs:Array<GC|Item>}} */ (clientsStructRefs.clients.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]))
208 } else {
209 return null
210 }
211 }
212 return nextStructsTarget
213 }
214 let curStructsTarget = getNextStructTarget()
215 if (curStructsTarget === null) {
216 return null

Callers 1

integrateStructsFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…