Skip to content

Commit

Permalink
Add optional values
Browse files Browse the repository at this point in the history
  • Loading branch information
spinillos committed Mar 22, 2023
1 parent 64a660c commit ddf366a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions testdata/recursive.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Recursive: {
map: [string]: Recursive
multipleValues: 23 | "abc" | [...MyStruct] | [...Recursive]
union: [...MyStruct] | [...Recursive]
optionalValue?: Recursive
optionalList?: [...Recursive]
optionalMap?: [string]: Recursive
optionalMultipleValues?: 23 | "abc" | [...MyStruct] | [...Recursive]
optionalUnion?: [...MyStruct] | [...Recursive]
} @cuetsy(kind="interface")

-- ts --
Expand All @@ -19,10 +24,16 @@ export interface Recursive {
map: Record<string, Recursive>;
multipleValues: (23 | 'abc' | Array<MyStruct> | Array<Recursive>);
myValue: string;
optionalList?: Array<Recursive>;
optionalMap?: Record<string, Recursive>;
optionalMultipleValues?: (23 | 'abc' | Array<MyStruct> | Array<Recursive>);
optionalUnion?: (Array<MyStruct> | Array<Recursive>);
optionalValue?: Recursive;
union: (Array<MyStruct> | Array<Recursive>);
value: Recursive;
}

export const defaultRecursive: Partial<Recursive> = {
list: [],
optionalList: [],
};

0 comments on commit ddf366a

Please sign in to comment.