-
-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Add ability to specify recursive types using a function wrapper
import {s} from 'json-joy/lib/json-crdt-patch';
const User = s.obj({
id: s.con(''),
name: s.str(''),
},
// Second object are optional fields
{
friend: () => User,
});
type UserType = {id: string, name: string, friend?: User};Binary tree example:
const Node = s.obj({
key: s.str(''),
value: s.str(''),
},
{
left: () => Node,
right: () => Node,
});
type UserType = {id: string, name: string, friend?: User};Copilot
Metadata
Metadata
Assignees
Labels
No labels