(encoder, sv)
| 578 | * @function |
| 579 | */ |
| 580 | export const writeStateVector = (encoder, sv) => { |
| 581 | encoding.writeVarUint(encoder.restEncoder, sv.size) |
| 582 | array.from(sv.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => { |
| 583 | encoding.writeVarUint(encoder.restEncoder, client) // @todo use a special client decoder that is based on mapping |
| 584 | encoding.writeVarUint(encoder.restEncoder, clock) |
| 585 | }) |
| 586 | return encoder |
| 587 | } |
| 588 | |
| 589 | /** |
| 590 | * @param {IdSetEncoderV1 | IdSetEncoderV2} encoder |
no test coverage detected
searching dependent graphs…