File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/json-crdt/codec/structural Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 11# Structural Codecs
22
3- Structural codecs encode the hierarchical structure of the document.
3+ Structural codecs encode the hierarchical structure of the document. Indexed
4+ codecs encode the document as a flat map of nodes.
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ export class Encoder extends CborEncoder<CrdtWriter> {
125125 const ts = this . ts ;
126126 const writer = this . writer ;
127127 ts ( node . id ) ;
128- this . writeTL ( CRDT_MAJOR_OVERLAY . ARR , node . size ( ) ) ;
128+ this . writeTL ( CRDT_MAJOR_OVERLAY . ARR , node . count ) ;
129129 const index = this . doc . index ;
130130 for ( let chunk = node . first ( ) ; chunk ; chunk = node . next ( chunk ) ) {
131131 const span = chunk . span ;
@@ -142,7 +142,7 @@ export class Encoder extends CborEncoder<CrdtWriter> {
142142 const ts = this . ts ;
143143 const writer = this . writer ;
144144 ts ( node . id ) ;
145- this . writeTL ( CRDT_MAJOR_OVERLAY . STR , node . size ( ) ) ;
145+ this . writeTL ( CRDT_MAJOR_OVERLAY . STR , node . count ) ;
146146 for ( let chunk = node . first ( ) ; chunk ; chunk = node . next ( chunk ) ) {
147147 ts ( chunk . id ) ;
148148 if ( chunk . del ) {
@@ -156,7 +156,7 @@ export class Encoder extends CborEncoder<CrdtWriter> {
156156 const ts = this . ts ;
157157 const writer = this . writer ;
158158 ts ( node . id ) ;
159- this . writeTL ( CRDT_MAJOR_OVERLAY . BIN , node . size ( ) ) ;
159+ this . writeTL ( CRDT_MAJOR_OVERLAY . BIN , node . count ) ;
160160 for ( let chunk = node . first ( ) ; chunk ; chunk = node . next ( chunk ) ) {
161161 const length = chunk . span ;
162162 const deleted = chunk . del ;
You can’t perform that action at this time.
0 commit comments