Skip to content

Commit 795c374

Browse files
committed
style(json-crdt-patch): 💄 run Prettier
1 parent bb52208 commit 795c374

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/json-crdt-patch/__tests__/compaction.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('.combine()', () => {
6767
expect(nop.id.time).toBe(2);
6868
expect(nop.len).toBe(98);
6969
});
70-
70+
7171
test('can combine four patches with gap', () => {
7272
const builder1 = new PatchBuilder(new LogicalClock(123456789, 1));
7373
const builder2 = new PatchBuilder(new LogicalClock(123456789, 100));
@@ -127,7 +127,7 @@ describe('.combine()', () => {
127127
const patch1 = builder1.flush();
128128
const patch2 = builder2.flush();
129129
expect(() => combine([patch2, patch1])).toThrow(new Error('TIMESTAMP_CONFLICT'));
130-
combine([patch1, patch2])
130+
combine([patch1, patch2]);
131131
});
132132
});
133133

src/json-crdt-patch/compaction.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
* together, and cleaning up operations.
44
*/
55

6-
import {equal, Timestamp} from "./clock";
7-
import {InsStrOp, NopOp} from "./operations";
8-
import type {JsonCrdtPatchOperation, Patch} from "./Patch";
6+
import {equal, Timestamp} from './clock';
7+
import {InsStrOp, NopOp} from './operations';
8+
import type {JsonCrdtPatchOperation, Patch} from './Patch';
99

1010
/**
1111
* Combines two or more patches together. The first patch is modified in place.
1212
* Operations from the second patch are appended to the first patch as is
1313
* (without cloning).
14-
*
14+
*
1515
* The patches must have the same `sid`. The first patch must have lower logical
1616
* time than the second patch, and the logical times must not overlap.
1717
*
@@ -63,7 +63,7 @@ export const compact = (patch: Patch): void => {
6363
const isTimeConsecutive = lastOpNextTick === op.id.time;
6464
const isInsertIntoSameString = equal(lastOp.obj, op.obj);
6565
const opRef = op.ref;
66-
const isAppend = (lastOpNextTick === (opRef.time + 1)) && (lastOp.ref.sid === opRef.sid);
66+
const isAppend = lastOpNextTick === opRef.time + 1 && lastOp.ref.sid === opRef.sid;
6767
if (isTimeConsecutive && isInsertIntoSameString && isAppend) {
6868
lastOp.data = lastOp.data + op.data;
6969
continue;

0 commit comments

Comments
 (0)