Skip to content

Commit 42d175c

Browse files
committed
style(json-crdt-patch): 💄 run Prettier
1 parent d601792 commit 42d175c

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

src/json-crdt-patch/Patch.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ export class Patch implements Printable {
207207
public toString(tab: string = ''): string {
208208
const id = this.getId();
209209
const header = `${this.constructor.name} ${id ? printTs(id) : '(nil)'}!${this.span()}`;
210-
return header + printTree(tab, this.ops.map((op) => (tab) => op.toString(tab)));
210+
return (
211+
header +
212+
printTree(
213+
tab,
214+
this.ops.map((op) => (tab) => op.toString(tab)),
215+
)
216+
);
211217
}
212218
}

src/json-crdt-patch/__demos__/PatchBuilder-konst.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ const builder = new PatchBuilder(clock);
1515
builder.json({
1616
bools: konst([true, false]),
1717
}),
18-
19-
console.log(builder.patch + '');
18+
console.log(builder.patch + '');
2019

2120
// Patch 123.456!3
2221
// ├─ "obj" 123.456

src/json-crdt-patch/operations.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,13 @@ export class InsObjOp implements IJsonCrdtPatchEditOperation {
210210

211211
public toString(tab: string = ''): string {
212212
const header = `${this.name()} ${printTs(this.id)}!${this.span()}, obj = ${printTs(this.obj)}`;
213-
return header + printTree(tab, this.data.map((item) => (tab) => `${JSON.stringify(item[0])}: ${printTs(item[1])}`));
213+
return (
214+
header +
215+
printTree(
216+
tab,
217+
this.data.map((item) => (tab) => `${JSON.stringify(item[0])}: ${printTs(item[1])}`),
218+
)
219+
);
214220
}
215221
}
216222

@@ -236,7 +242,13 @@ export class InsVecOp implements IJsonCrdtPatchEditOperation {
236242

237243
public toString(tab: string = ''): string {
238244
const header = `${this.name()} ${printTs(this.id)}!${this.span()}, obj = ${printTs(this.obj)}`;
239-
return header + printTree(tab, this.data.map((item) => (tab) => `${item[0]}: ${printTs(item[1])}`));
245+
return (
246+
header +
247+
printTree(
248+
tab,
249+
this.data.map((item) => (tab) => `${item[0]}: ${printTs(item[1])}`),
250+
)
251+
);
240252
}
241253
}
242254

0 commit comments

Comments
 (0)