Skip to content

Commit

Permalink
refactor(json-crdt): 💡 stop using deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Oct 27, 2023
1 parent f308d42 commit fbe21ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/json-crdt/codec/structural/binary/Encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ export class Encoder extends MsgPackEncoder<CrdtWriter> {

protected cObj(obj: ObjectLww): void {
this.ts(obj.id);
this.encodeObjectHeader(obj.keys.size);
this.writeObjHdr(obj.keys.size);
obj.keys.forEach(this.cKey);
}

protected readonly cKey = (val: ITimestampStruct, key: string) => {
this.encodeString(key);
this.writeStr(key);
this.cNode(this.doc.index.get(val)!);
};

Expand All @@ -124,7 +124,7 @@ export class Encoder extends MsgPackEncoder<CrdtWriter> {
const ts = this.ts;
const writer = this.writer;
ts(obj.id);
this.encodeArrayHeader(obj.size());
this.writeArrHdr(obj.size());
const index = this.doc.index;
for (let chunk = obj.first(); chunk; chunk = obj.next(chunk)) {
const span = chunk.span;
Expand All @@ -142,7 +142,7 @@ export class Encoder extends MsgPackEncoder<CrdtWriter> {
const writer = this.writer;
ts(obj.id);
const length = obj.size();
this.encodeStringHeader(length);
this.writeStrHdr(length);
for (let chunk = obj.first(); chunk; chunk = obj.next(chunk)) {
ts(chunk.id);
if (chunk.del) {
Expand All @@ -157,7 +157,7 @@ export class Encoder extends MsgPackEncoder<CrdtWriter> {
const writer = this.writer;
ts(obj.id);
const length = obj.size();
this.encodeBinaryHeader(length);
this.writeBinHdr(length);
for (let chunk = obj.first(); chunk; chunk = obj.next(chunk)) {
const length = chunk.span;
const deleted = chunk.del;
Expand Down

0 comments on commit fbe21ae

Please sign in to comment.