Skip to content

Commit 7e12584

Browse files
committed
style(json-crdt): 💄 run Prettier
1 parent 16e946b commit 7e12584

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

src/json-crdt/codec/structural/binary/Decoder.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,20 @@ export class Decoder extends CborDecoderBase<CrdtReader> {
8888
const minor = octet & 0b11111;
8989
const length = minor < 24 ? minor : minor === 24 ? reader.u8() : minor === 25 ? reader.u16() : reader.u32();
9090
switch (major) {
91-
case CRDT_MAJOR.CON: return this.cCon(id, length);
92-
case CRDT_MAJOR.VAL: return this.cVal(id);
93-
case CRDT_MAJOR.VEC: return this.cVec(id, length);
94-
case CRDT_MAJOR.OBJ: return this.cObj(id, length);
95-
case CRDT_MAJOR.STR: return this.cStr(id, length);
96-
case CRDT_MAJOR.BIN: return this.cBin(id, length);
97-
case CRDT_MAJOR.ARR: return this.cArr(id, length);
91+
case CRDT_MAJOR.CON:
92+
return this.cCon(id, length);
93+
case CRDT_MAJOR.VAL:
94+
return this.cVal(id);
95+
case CRDT_MAJOR.VEC:
96+
return this.cVec(id, length);
97+
case CRDT_MAJOR.OBJ:
98+
return this.cObj(id, length);
99+
case CRDT_MAJOR.STR:
100+
return this.cStr(id, length);
101+
case CRDT_MAJOR.BIN:
102+
return this.cBin(id, length);
103+
case CRDT_MAJOR.ARR:
104+
return this.cArr(id, length);
98105
}
99106
throw new Error('UNKNOWN_NODE');
100107
}

src/json-crdt/codec/structural/binary/Encoder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class Encoder extends CborEncoder<CrdtWriter> {
8787

8888
protected cNode(node: JsonNode): void {
8989
// TODO: PERF: use a switch?
90-
if (node instanceof ConNode) this.cCon(node);
90+
if (node instanceof ConNode) this.cCon(node);
9191
else if (node instanceof ValNode) this.cVal(node);
9292
else if (node instanceof StrNode) this.cStr(node);
9393
else if (node instanceof ObjNode) this.cObj(node);

src/json-crdt/codec/structural/binary/ViewDecoder.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,20 @@ export class ViewDecoder extends CborDecoderBase<CrdtReader> {
4141
const minor = octet & 0b11111;
4242
const length = minor < 24 ? minor : minor === 24 ? reader.u8() : minor === 25 ? reader.u16() : reader.u32();
4343
switch (major) {
44-
case CRDT_MAJOR.CON: return this.cCon(length);
45-
case CRDT_MAJOR.VAL: return this.cNode();
46-
case CRDT_MAJOR.VEC: return this.cVec(length);
47-
case CRDT_MAJOR.OBJ: return this.cObj(length);
48-
case CRDT_MAJOR.STR: return this.cStr(length);
49-
case CRDT_MAJOR.BIN: return this.cBin(length);
50-
case CRDT_MAJOR.ARR: return this.cArr(length);
44+
case CRDT_MAJOR.CON:
45+
return this.cCon(length);
46+
case CRDT_MAJOR.VAL:
47+
return this.cNode();
48+
case CRDT_MAJOR.VEC:
49+
return this.cVec(length);
50+
case CRDT_MAJOR.OBJ:
51+
return this.cObj(length);
52+
case CRDT_MAJOR.STR:
53+
return this.cStr(length);
54+
case CRDT_MAJOR.BIN:
55+
return this.cBin(length);
56+
case CRDT_MAJOR.ARR:
57+
return this.cArr(length);
5158
}
5259
return undefined;
5360
}

0 commit comments

Comments
 (0)