From a5ebd2f7a6d54041e16c0ad7ef9f5e63e49cb20f Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Thu, 23 May 2024 18:39:24 +0900 Subject: [PATCH] Revise codes --- src/document/crdt/root.ts | 2 +- src/document/crdt/text.ts | 10 +++++----- src/document/crdt/tree.ts | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/document/crdt/root.ts b/src/document/crdt/root.ts index 05260bcb7..efe2305af 100644 --- a/src/document/crdt/root.ts +++ b/src/document/crdt/root.ts @@ -83,7 +83,7 @@ export class CRDTRoot { this.registerRemovedElement(elem); } if (elem instanceof CRDTText || elem instanceof CRDTTree) { - for (const pair of elem.GCPairs()) { + for (const pair of elem.getGCPairs()) { this.registerGCPair(pair); } } diff --git a/src/document/crdt/text.ts b/src/document/crdt/text.ts index 11c6f8629..df5442de1 100644 --- a/src/document/crdt/text.ts +++ b/src/document/crdt/text.ts @@ -170,9 +170,9 @@ export class CRDTTextValue { } /** - * `GCPairs` returns the pairs of GC. + * `getGCPairs` returns the pairs of GC. */ - public GCPairs(): Array { + public getGCPairs(): Array { const pairs = []; for (const node of this.attributes) { @@ -464,16 +464,16 @@ export class CRDTText extends CRDTElement { } /** - * `GCPairs` returns the pairs of GC. + * `getGCPairs` returns the pairs of GC. */ - public GCPairs(): Array { + public getGCPairs(): Array { const pairs = []; for (const node of this.rgaTreeSplit) { if (node.getRemovedAt()) { pairs.push({ parent: this.rgaTreeSplit, child: node }); } - for (const p of node.getValue().GCPairs()) { + for (const p of node.getValue().getGCPairs()) { pairs.push(p); } } diff --git a/src/document/crdt/tree.ts b/src/document/crdt/tree.ts index b7b518651..fa3e1b5cf 100644 --- a/src/document/crdt/tree.ts +++ b/src/document/crdt/tree.ts @@ -668,9 +668,9 @@ export class CRDTTreeNode } /** - * `GCPairs` returns the pairs of GC. + * `getGCPairs` returns the pairs of GC. */ - public GCPairs(): Array { + public getGCPairs(): Array { const pairs: Array = []; if (!this.attrs) { return pairs; @@ -1221,16 +1221,16 @@ export class CRDTTree extends CRDTElement implements GCParent { } /** - * `GCPairs` returns the pairs of GC. + * `getGCPairs` returns the pairs of GC. */ - public GCPairs(): Array { + public getGCPairs(): Array { const pairs: Array = []; this.indexTree.traverse((node) => { if (node.getRemovedAt()) { pairs.push({ parent: this, child: node }); } - for (const p of node.GCPairs()) { + for (const p of node.getGCPairs()) { pairs.push(p); } });