MCPcopy
hub / github.com/yjs/yjs / encodeStateVectorV2

Function encodeStateVectorV2

src/utils/encoding.js:606–613  ·  view source on GitHub ↗
(doc, encoder = new IdSetEncoderV2())

Source from the content-addressed store, hash-verified

604 * @function
605 */
606export const encodeStateVectorV2 = (doc, encoder = new IdSetEncoderV2()) => {
607 if (doc instanceof Map) {
608 writeStateVector(encoder, doc)
609 } else {
610 writeDocumentStateVector(encoder, doc)
611 }
612 return encoder.toUint8Array()
613}
614
615/**
616 * Encode State as Uint8Array.

Callers 1

encodeStateVectorFunction · 0.85

Calls 3

writeStateVectorFunction · 0.85
writeDocumentStateVectorFunction · 0.85
toUint8ArrayMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…