Type Alias InferOf<TKey, TSchema>

InferOf<TKey, TSchema>: TKey extends `${infer T}.${infer K}`
    ? InferOf<K, TSchema["shape"][T] extends z.ZodOptional<any>
        ? ReturnType<TSchema["shape"][T]["unwrap"]>
        : TSchema["shape"][T]>
    : z.infer<TSchema["shape"][TKey]>

Extracts the inferred type of a nested key from a schema.

Type Parameters

  • TKey extends string
  • TSchema extends z.ZodObject<any>