zod 4.2.0-canary.20251202T062120 → 4.2.0-canary.20251207T223211

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod",
3
- "version": "4.2.0-canary.20251202T062120",
3
+ "version": "4.2.0-canary.20251207T223211",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Colin McDonnell <zod@colinhacks.com>",
@@ -0,0 +1,26 @@
1
+ import { expect, test } from "vitest";
2
+ import { type infer as _infer, json, nullable, object, pipe, transform } from "../../mini/index.js";
3
+ // biome-ignore lint/correctness/noUnusedImports: This import verifies the type is exported
4
+ import type { _ZodMiniJSONSchema } from "../../mini/schemas.js";
5
+
6
+ const DataType = object({
7
+ data: json(),
8
+ });
9
+ type DataType = _infer<typeof DataType>;
10
+
11
+ // biome-ignore lint/suspicious/noExportsInTest: This export is required to reproduce TS4023
12
+ export const Container = object({
13
+ contained: pipe(
14
+ nullable(DataType),
15
+ transform<DataType | null>(
16
+ (v) =>
17
+ v ?? {
18
+ data: "",
19
+ }
20
+ )
21
+ ),
22
+ });
23
+
24
+ test("issue reproduction should compile without type errors", () => {
25
+ expect(Container).toBeDefined();
26
+ });
@@ -1649,7 +1649,7 @@ export const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMi
1649
1649
  // json
1650
1650
 
1651
1651
  // json
1652
- type _ZodMiniJSONSchema = ZodMiniUnion<
1652
+ export type _ZodMiniJSONSchema = ZodMiniUnion<
1653
1653
  [
1654
1654
  ZodMiniString,
1655
1655
  ZodMiniNumber,
@@ -1659,7 +1659,7 @@ type _ZodMiniJSONSchema = ZodMiniUnion<
1659
1659
  ZodMiniRecord<ZodMiniString<string>, ZodMiniJSONSchema>,
1660
1660
  ]
1661
1661
  >;
1662
- type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
1662
+ export type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
1663
1663
 
1664
1664
  export interface ZodMiniJSONSchemaInternals extends _ZodMiniJSONSchemaInternals {
1665
1665
  output: util.JSONType;
@@ -365,7 +365,7 @@ declare abstract class Class {
365
365
  declare function _instanceof<T extends typeof Class>(cls: T, params?: core.$ZodCustomParams): ZodMiniCustom<InstanceType<T>, InstanceType<T>>;
366
366
  export { _instanceof as instanceof };
367
367
  export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMiniCodec<ZodMiniString, ZodMiniBoolean>;
368
- type _ZodMiniJSONSchema = ZodMiniUnion<[
368
+ export type _ZodMiniJSONSchema = ZodMiniUnion<[
369
369
  ZodMiniString,
370
370
  ZodMiniNumber,
371
371
  ZodMiniBoolean,
@@ -373,7 +373,7 @@ type _ZodMiniJSONSchema = ZodMiniUnion<[
373
373
  ZodMiniArray<ZodMiniJSONSchema>,
374
374
  ZodMiniRecord<ZodMiniString<string>, ZodMiniJSONSchema>
375
375
  ]>;
376
- type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
376
+ export type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
377
377
  export interface ZodMiniJSONSchemaInternals extends _ZodMiniJSONSchemaInternals {
378
378
  output: util.JSONType;
379
379
  input: util.JSONType;
@@ -365,7 +365,7 @@ declare abstract class Class {
365
365
  declare function _instanceof<T extends typeof Class>(cls: T, params?: core.$ZodCustomParams): ZodMiniCustom<InstanceType<T>, InstanceType<T>>;
366
366
  export { _instanceof as instanceof };
367
367
  export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMiniCodec<ZodMiniString, ZodMiniBoolean>;
368
- type _ZodMiniJSONSchema = ZodMiniUnion<[
368
+ export type _ZodMiniJSONSchema = ZodMiniUnion<[
369
369
  ZodMiniString,
370
370
  ZodMiniNumber,
371
371
  ZodMiniBoolean,
@@ -373,7 +373,7 @@ type _ZodMiniJSONSchema = ZodMiniUnion<[
373
373
  ZodMiniArray<ZodMiniJSONSchema>,
374
374
  ZodMiniRecord<ZodMiniString<string>, ZodMiniJSONSchema>
375
375
  ]>;
376
- type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
376
+ export type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
377
377
  export interface ZodMiniJSONSchemaInternals extends _ZodMiniJSONSchemaInternals {
378
378
  output: util.JSONType;
379
379
  input: util.JSONType;