Skip to content

Commit 0723a09

Browse files
committed
style(json-crdt): 💄 run Prettier
1 parent 6f35c01 commit 0723a09

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/json-crdt/model/api/ModelApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class ModelApi<N extends JsonNode = JsonNode> implements SyncStore<JsonNo
191191
/**
192192
* Locates a `con` node and returns a local changes API for it. If the node
193193
* doesn't exist or the node at the path is not a `con` node, throws an error.
194-
*
194+
*
195195
* @todo Rename to `con`.
196196
*
197197
* @param path Path at which to locate a node.

src/json-crdt/schema/__tests__/types.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ describe('can infer schema of JSON CRDT nodes', () => {
4141
});
4242

4343
test('from typed model', () => {
44-
const model = Model.withLogicalClock().setSchema(s.obj({
45-
id: s.con('asdf'),
46-
age: s.val(s.con(42)),
47-
}));
44+
const model = Model.withLogicalClock().setSchema(
45+
s.obj({
46+
id: s.con('asdf'),
47+
age: s.val(s.con(42)),
48+
}),
49+
);
4850
type Node = ReturnType<typeof model.root.node>;
4951
type Schema = JsonNodeToSchema<Node>;
5052
const schema: Schema = s.obj({

src/json-crdt/schema/toSchema.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import {JsonNode, ConNode, ValNode, ObjNode, VecNode, StrNode, BinNode, ArrNode} from "../nodes";
2-
import {NodeBuilder, s} from "../../json-crdt-patch";
3-
import type {JsonNodeToSchema} from "./types";
1+
import {JsonNode, ConNode, ValNode, ObjNode, VecNode, StrNode, BinNode, ArrNode} from '../nodes';
2+
import {NodeBuilder, s} from '../../json-crdt-patch';
3+
import type {JsonNodeToSchema} from './types';
44

55
/**
66
* Converts any JSON CRDT node to a schema representation. The schema can be
77
* used to copy the structure of the JSON CRDT node to another document or
88
* another location in the same document.
9-
*
10-
* @todo Add type generic.
11-
*
9+
*
1210
* @param node JSON CRDT node to recursively convert to schema.
1311
* @returns Schema representation of the JSON CRDT node.
1412
*/
@@ -17,7 +15,7 @@ export const toSchema = <N extends JsonNode<any>>(node: N): JsonNodeToSchema<N>
1715
if (node instanceof ValNode) return s.val(toSchema(node.node())) as any;
1816
if (node instanceof ObjNode) {
1917
const obj: Record<string, NodeBuilder> = {};
20-
node.nodes((child, key) => obj[key] = toSchema(child));
18+
node.nodes((child, key) => (obj[key] = toSchema(child)));
2119
return s.obj(obj) as any;
2220
}
2321
if (node instanceof VecNode) {

0 commit comments

Comments
 (0)