zod 3.25.42 → 3.25.43-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,7 @@ export interface ZodType<out Output = unknown, out Input = unknown> extends core
23
23
  spa: (data: unknown, params?: core.ParseContext<core.$ZodIssue>) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
24
24
  refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
25
25
  /** @deprecated Use `.check()` instead. */
26
- superRefine(refinement: (arg: core.output<this>, ctx: RefinementCtx<this["_zod"]["output"]>) => void | Promise<void>): this;
26
+ superRefine(refinement: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => void | Promise<void>): this;
27
27
  overwrite(fn: (x: core.output<this>) => core.output<this>): this;
28
28
  optional(): ZodOptional<this>;
29
29
  nonoptional(params?: string | core.$ZodNonOptionalParams): ZodNonOptional<this>;
@@ -39,7 +39,7 @@ export interface ZodType<out Output = unknown, out Input = unknown> extends core
39
39
  transform<NewOut>(transform: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
40
40
  catch(def: core.output<this>): ZodCatch<this>;
41
41
  catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
42
- pipe<T extends core.$ZodType<any, this["_zod"]["output"]>>(target: T | core.$ZodType<any, this["_zod"]["output"]>): ZodPipe<this, T>;
42
+ pipe<T extends core.$ZodType<any, core.output<this>>>(target: T | core.$ZodType<any, core.output<this>>): ZodPipe<this, T>;
43
43
  readonly(): ZodReadonly<this>;
44
44
  /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
45
45
  describe(description: string): this;
@@ -1,3 +1,4 @@
1
+ import type * as core from "./core.js";
1
2
  import * as schemas from "./schemas.js";
2
3
  import { $ZodTuple } from "./schemas.js";
3
4
  import type * as util from "./util.js";
@@ -9,10 +10,10 @@ export interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out
9
10
  export type $ZodFunctionArgs = schemas.$ZodType<unknown[], unknown[]>;
10
11
  export type $ZodFunctionIn = $ZodFunctionArgs;
11
12
  export type $ZodFunctionOut = schemas.$ZodType;
12
- export type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : Args["_zod"]["output"]) => Returns["_zod"]["input"];
13
- export type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : Args["_zod"]["output"]) => util.MaybeAsync<Returns["_zod"]["input"]>;
14
- export type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : Args["_zod"]["input"]) => Returns["_zod"]["output"];
15
- export type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : Args["_zod"]["input"]) => util.MaybeAsync<Returns["_zod"]["output"]>;
13
+ export type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.output<Args>) => core.input<Returns>;
14
+ export type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.output<Args>) => util.MaybeAsync<core.input<Returns>>;
15
+ export type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.input<Args>) => core.output<Returns>;
16
+ export type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.input<Args>) => util.MaybeAsync<core.output<Returns>>;
16
17
  export declare class $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> {
17
18
  def: $ZodFunctionDef<Args, Returns>;
18
19
  /** @deprecated */
@@ -2,7 +2,7 @@ import * as core from "zod/v4/core";
2
2
  import { util } from "zod/v4/core";
3
3
  type SomeType = core.$ZodType;
4
4
  export interface ZodMiniType<out Output = unknown, out Input = unknown> extends core.$ZodType<Output, Input> {
5
- check(...checks: (core.CheckFn<this["_zod"]["output"]> | core.$ZodCheck<this["_zod"]["output"]>)[]): this;
5
+ check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
6
6
  clone(def?: this["_zod"]["def"], params?: {
7
7
  parent: boolean;
8
8
  }): this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod",
3
- "version": "3.25.42",
3
+ "version": "3.25.43-beta.0",
4
4
  "type": "module",
5
5
  "author": "Colin McDonnell <zod@colinhacks.com>",
6
6
  "description": "TypeScript-first schema declaration and validation library with static type inference",
package/v3/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "../dist/types/v3/index.d.ts";
1
+ export * from "../dist/types/v3/index.js";
@@ -1 +1 @@
1
- export * from "../../dist/types/v4/core/index.d.ts";
1
+ export * from "../../dist/types/v4/core/index.js";
package/v4/index.d.ts CHANGED
@@ -1 +1,3 @@
1
- export * from "../dist/types/v4/index.d.ts";
1
+ import z from "./dist/types/v4/index.js";
2
+ export * from "../dist/types/v4/index.js";
3
+ export default z;
@@ -1 +1 @@
1
- export * from "../../dist/types/v4/locales/index.d.ts";
1
+ export * from "../../dist/types/v4/locales/index.js";
@@ -1 +1 @@
1
- export * from "../dist/types/v4/mini/index.d.ts";
1
+ export * from "../dist/types/v4/mini/index.js";