MCPcopy
hub / github.com/yjs/yjs / toUint8Array

Method toUint8Array

src/utils/UpdateEncoder.js:187–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

185 }
186
187 toUint8Array () {
188 const encoder = encoding.createEncoder()
189 encoding.writeVarUint(encoder, 0) // this is a feature flag that we might use in the future
190 encoding.writeVarUint8Array(encoder, this.keyClockEncoder.toUint8Array())
191 encoding.writeVarUint8Array(encoder, this.clientEncoder.toUint8Array())
192 encoding.writeVarUint8Array(encoder, this.leftClockEncoder.toUint8Array())
193 encoding.writeVarUint8Array(encoder, this.rightClockEncoder.toUint8Array())
194 encoding.writeVarUint8Array(encoder, encoding.toUint8Array(this.infoEncoder))
195 encoding.writeVarUint8Array(encoder, this.stringEncoder.toUint8Array())
196 encoding.writeVarUint8Array(encoder, encoding.toUint8Array(this.parentInfoEncoder))
197 encoding.writeVarUint8Array(encoder, this.typeRefEncoder.toUint8Array())
198 encoding.writeVarUint8Array(encoder, this.lenEncoder.toUint8Array())
199 // @note The rest encoder is appended! (note the missing var)
200 encoding.writeUint8Array(encoder, encoding.toUint8Array(this.restEncoder))
201 return encoding.toUint8Array(encoder)
202 }
203
204 /**
205 * @param {ID} id

Callers 5

readAndApplyDeleteSetFunction · 0.95
createDocFromSnapshotFunction · 0.95
integrateStructsFunction · 0.95
cleanupTransactionsFunction · 0.95
checkUpdateCasesFunction · 0.95

Calls 1

toUint8ArrayMethod · 0.45

Tested by

no test coverage detected