From 624495b25b958beb3893aaa4affec506fa9274ed Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Thu, 30 Apr 2026 22:30:28 +0200 Subject: [PATCH 1/2] Using PropertyKey built-in type for symbol,string,number union. --- zod-plugin/src/augmentation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zod-plugin/src/augmentation.ts b/zod-plugin/src/augmentation.ts index 0eeac16fba..343d00d664 100644 --- a/zod-plugin/src/augmentation.ts +++ b/zod-plugin/src/augmentation.ts @@ -6,7 +6,7 @@ declare module "zod/v4/core" { interface GlobalMeta { default?: unknown; // can be an actual value or a label like "Today" examples?: unknown[]; // see zod commit ee5615d - [brandProperty]?: symbol | string | number; + [brandProperty]?: PropertyKey; } } From 4d0f807b0550b8a9276f7ff138e540479ebbf72a Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Thu, 30 Apr 2026 22:30:48 +0200 Subject: [PATCH 2/2] Add test for the type of the xBrand() method. --- zod-plugin/tests/index.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zod-plugin/tests/index.spec.ts b/zod-plugin/tests/index.spec.ts index aa296ec7f7..ad61a3347e 100644 --- a/zod-plugin/tests/index.spec.ts +++ b/zod-plugin/tests/index.spec.ts @@ -3,6 +3,9 @@ import * as entrypoint from "../src"; describe("Entrypoint", () => { test("Augmentation", () => { + expectTypeOf() + .toHaveProperty("xBrand") + .toEqualTypeOf<(brand?: PropertyKey) => z.ZodAny>(); expectTypeOf() .toHaveProperty("example") .toEqualTypeOf<(value: any) => z.ZodAny>(); @@ -24,7 +27,7 @@ describe("Entrypoint", () => { expectTypeOf>() .exclude(undefined) .toHaveProperty("x-brand") - .toEqualTypeOf(); + .toEqualTypeOf(); }); test("has no exports", () => {