Skip to content

Commit eccb1a3

Browse files
committed
fix(json-crdt): 🐛 iterate over chunks
1 parent 15b89a1 commit eccb1a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/json-crdt/codec/structural/compact/Decoder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class Decoder {
116116
const size = chunks.length;
117117
let i = 0;
118118
obj.ingest(size, () => {
119-
const chunk = chunks[i];
119+
const chunk = chunks[i++];
120120
const chunkId = this.ts(chunk[0]);
121121
const content = chunk[1];
122122
if (typeof content === 'number') return new nodes.StrChunk(chunkId, content, '');
@@ -133,7 +133,7 @@ export class Decoder {
133133
const size = chunks.length;
134134
let i = 0;
135135
obj.ingest(size, () => {
136-
const chunk = chunks[i];
136+
const chunk = chunks[i++];
137137
const chunkId = this.ts(chunk[0]);
138138
const content = chunk[1];
139139
if (typeof content === 'number') return new nodes.BinChunk(chunkId, content, undefined);
@@ -150,7 +150,7 @@ export class Decoder {
150150
const size = chunks.length;
151151
let i = 0;
152152
obj.ingest(size, () => {
153-
const chunk = chunks[i];
153+
const chunk = chunks[i++];
154154
const chunkId = this.ts(chunk[0]);
155155
const content = chunk[1];
156156
if (typeof content === 'number') return new nodes.ArrChunk(chunkId, content, undefined);

0 commit comments

Comments
 (0)