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; } } 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", () => {