Skip to content

Commit a6e83c8

Browse files
committed
style(json-crdt): 💄 run Prettier
1 parent 7e451bb commit a6e83c8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/json-crdt/model/Model.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,18 @@ export class Model<RootJsonNode extends JsonNode = JsonNode> implements Printabl
344344
nl,
345345
(tab) => {
346346
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)}`));
347+
this.index.forEach((item) => nodes.push(item.v));
348+
return (
349+
`Index (${nodes.length} nodes)` +
350+
printTree(
351+
tab,
352+
nodes.map((node) => (tab) => `${node.constructor.name} ${toDisplayString(node.id)}`),
353+
)
354+
);
349355
},
350356
nl,
351357
// (tab) => `View ${toTree(this.view(), tab)}`,
352-
(tab) => `View${printTree(tab, [tab => JSON.stringify(this.view(), null, 2).replace(/\n/g, '\n' + tab)])}`,
358+
(tab) => `View${printTree(tab, [(tab) => JSON.stringify(this.view(), null, 2).replace(/\n/g, '\n' + tab)])}`,
353359
nl,
354360
(tab) => this.clock.toString(tab),
355361
hasExtensions ? nl : null,

src/json-crdt/nodes/vec/VecNode.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,7 @@ export class VecNode<Value extends JsonNode[] = JsonNode[]>
175175
public toString(tab: string = ''): string {
176176
const extNode = this.ext();
177177
const header =
178-
this.constructor.name +
179-
' ' +
180-
toDisplayString(this.id) +
181-
(extNode ? ` { extension = ${this.getExtId()} }` : '');
178+
this.constructor.name + ' ' + toDisplayString(this.id) + (extNode ? ` { extension = ${this.getExtId()} }` : '');
182179
if (extNode) {
183180
return this.child()!.toString(tab);
184181
}

0 commit comments

Comments
 (0)