MCPcopy
hub / github.com/yjs/yjs / _insertIntoIdSet

Function _insertIntoIdSet

src/utils/IdSet.js:425–437  ·  view source on GitHub ↗
(dest, src)

Source from the content-addressed store, hash-verified

423 * @param {S} src
424 */
425export const _insertIntoIdSet = (dest, src) => {
426 src.clients.forEach((srcRanges, client) => {
427 const targetRanges = dest.clients.get(client)
428 if (targetRanges) {
429 array.appendTo(targetRanges.getIds(), srcRanges.getIds())
430 targetRanges.sorted = false
431 } else {
432 const res = srcRanges.copy()
433 res.sorted = true
434 dest.clients.set(client, /** @type {any} */ (res))
435 }
436 })
437}
438
439/**
440 * @param {IdSet} dest

Callers

nothing calls this directly

Calls 4

forEachMethod · 0.45
getMethod · 0.45
getIdsMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…