File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 1+ import * as core from 'zod/v4/core'
12import { rootFake } from './internals/fake'
2- import { ZodType } from './internals/type'
33
4- export function fake < T extends ZodType > ( schema : T ) : T [ '_zod' ] [ 'output' ] {
4+ export function fake < T extends core . $ ZodType> ( schema : T ) : T [ '_zod' ] [ 'output' ] {
55 return rootFake ( schema , { depth : 0 } )
66}
Original file line number Diff line number Diff line change 11import * as core from 'zod/v4/core'
22import { Context } from '../context'
3- import { Fake , Infer , RootFake , ZodType } from '../type'
3+ import { Fake , Infer , RootFake } from '../type'
44
5- const customs = new Map < ZodType , Fake < ZodType > > ( )
6- export function custom < T extends ZodType > ( schema : T , fake : Fake < T > ) : void {
5+ const customs = new Map < core . $ ZodType, Fake < core . $ ZodType> > ( )
6+ export function custom < T extends core . $ ZodType> ( schema : T , fake : Fake < T > ) : void {
77 customs . set ( schema , fake as any )
88}
99
Original file line number Diff line number Diff line change 1+ import * as core from 'zod/v4/core'
12import { Context } from './context'
23
3- export type ZodType < O = unknown > = { _zod : { output : O } } // TODO: use core.$ZodType
4+ export type Infer < T extends core . $ZodType > = T [ ' _zod' ] [ ' output' ]
45
5- export type Infer < T extends ZodType > = T [ '_zod' ] [ 'output' ]
6+ export type Fake < T extends core . $ ZodType> = ( schema : T , context : Context , fake : RootFake ) => Infer < T >
67
7- export type Fake < T extends ZodType > = ( schema : T , context : Context , fake : RootFake ) => Infer < T >
8-
9- export type RootFake = < T extends ZodType > ( schema : T , context : Context ) => Infer < T >
8+ export type RootFake = < T extends core . $ZodType > ( schema : T , context : Context ) => Infer < T >
You can’t perform that action at this time.
0 commit comments