File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 88 VectorClock ,
99 ServerVectorClock ,
1010 compare ,
11+ toDisplayString ,
1112} from '../../json-crdt-patch/clock' ;
1213import { JsonCrdtPatchOperation , Patch } from '../../json-crdt-patch/Patch' ;
1314import { ModelApi } from './api/ModelApi' ;
@@ -340,8 +341,12 @@ export class Model<RootJsonNode extends JsonNode = JsonNode> implements Printabl
340341 this . constructor . name +
341342 printTree ( tab , [
342343 ( tab ) => this . root . toString ( tab ) ,
343- // nl,
344- // (tab) => this.index.toString(tab),
344+ nl ,
345+ ( tab ) => {
346+ const nodes : JsonNode [ ] = [ ] ;
347+ this . index . forEach ( item => nodes . push ( item . v ) ) ;
348+ return `Index (${ nodes . length } nodes)` + printTree ( tab , nodes . map ( node => ( tab ) => `${ node . constructor . name } ${ toDisplayString ( node . id ) } ` ) ) ;
349+ } ,
345350 nl ,
346351 ( tab ) => this . clock . toString ( tab ) ,
347352 hasExtensions ? nl : null ,
You can’t perform that action at this time.
0 commit comments