Skip to content

Commit 20d1c23

Browse files
committed
feat(json-crdt): 🎸 use .value attribute in val node
1 parent 0c568bb commit 20d1c23

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export class Decoder {
3030
return isServerClock ? ts(SESSION.SERVER, stamp) : ts(stamp[0], stamp[1]);
3131
}
3232

33-
protected cRoot(doc: Model, {node}: types.ValueJsonCrdtNode): void {
34-
const val = node ? this.cNode(doc, node) : new nodes.ConNode(doc.clock.tick(0), null);
33+
protected cRoot(doc: Model, {value}: types.ValueJsonCrdtNode): void {
34+
const val = value ? this.cNode(doc, value) : new nodes.ConNode(doc.clock.tick(0), null);
3535
const root = new nodes.RootNode(doc, val.id);
3636
doc.root = root;
3737
}
@@ -155,7 +155,7 @@ export class Decoder {
155155

156156
protected cVal(doc: Model, node: types.ValueJsonCrdtNode): nodes.ValNode {
157157
const id = this.cTs(node.id);
158-
const val = this.cNode(doc, node.node);
158+
const val = this.cNode(doc, node.value);
159159
const obj = new nodes.ValNode(doc, id, val.id);
160160
doc.index.set(id, obj);
161161
return obj;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class Encoder {
157157
return {
158158
type: 'val',
159159
id: this.cTs(obj.id),
160-
node: this.cNode(obj.node()),
160+
value: this.cNode(obj.node()),
161161
};
162162
}
163163

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export interface JsonCrdtRgaTombstone {
100100
export interface ValueJsonCrdtNode {
101101
type: 'val';
102102
id: JsonCrdtTimestamp;
103-
node: JsonCrdtNode;
103+
value: JsonCrdtNode;
104104
}
105105

106106
/**

0 commit comments

Comments
 (0)