Skip to content

Commit 239d795

Browse files
committed
feat(json-crdt): 🎸 use .value attribute int arr chunk
1 parent 9969b37 commit 239d795

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class Decoder {
9898
if (typeof (c as types.JsonCrdtRgaTombstone).span === 'number')
9999
return new nodes.ArrChunk(id, (c as types.JsonCrdtRgaTombstone).span, undefined);
100100
else {
101-
const ids = (c as types.ArrayJsonCrdtChunk).nodes.map((n) => this.cNode(doc, n).id);
101+
const ids = (c as types.ArrayJsonCrdtChunk).value.map((n) => this.cNode(doc, n).id);
102102
return new nodes.ArrChunk(id, ids.length, ids);
103103
}
104104
});

src/json-crdt/codec/structural/verbose/Encoder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class Encoder {
9494
const index = this.model.index;
9595
const res: types.ArrayJsonCrdtChunk = {
9696
id: this.cTs(chunk.id),
97-
nodes: chunk.data!.map((n) => this.cNode(index.get(n)!)),
97+
value: chunk.data!.map((n) => this.cNode(index.get(n)!)),
9898
};
9999
return res;
100100
}

src/json-crdt/codec/structural/verbose/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export interface ArrayJsonCrdtNode {
102102

103103
export interface ArrayJsonCrdtChunk {
104104
id: JsonCrdtTimestamp;
105-
nodes: JsonCrdtNode[];
105+
value: JsonCrdtNode[];
106106
}
107107

108108
/**

0 commit comments

Comments
 (0)