File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ import type {
33 StringPath ,
44 FormPathType ,
55 FormPathArrays ,
6- StringPathLeaves
6+ StringPathLeaves ,
7+ FormPathLeaves
78} from '$lib/stringPath' ;
89import { test } from 'vitest' ;
10+ import { z } from 'zod' ;
911
1012type Obj = {
1113 name : string ;
@@ -173,3 +175,14 @@ test('Objects with sets', () => {
173175 // @ts -expect-error incorrect path
174176 const b3 : SetTest = 'numbers.set.size' ;
175177} ) ;
178+
179+ // Recursive schema test
180+ const baseExampleSchema = z . object ( {
181+ name : z . string ( )
182+ } ) ;
183+
184+ const exampleSchema = baseExampleSchema . extend ( {
185+ children : z . lazy ( ( ) => baseExampleSchema . array ( ) . optional ( ) )
186+ } ) ;
187+
188+ type ExampleFormPathLeaves = FormPathLeaves < z . infer < typeof exampleSchema > > ;
You can’t perform that action at this time.
0 commit comments