Follow up: unify v3 and v4 zod types via describe matrix and a test helper (#1141)

This commit is contained in:
Konstantin Konstantinov 2025-11-20 12:10:15 +02:00 • committed by GitHub
commit 43189335a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,22 @@
import * as z3 from 'zod/v3';
import * as z4 from 'zod/v4';
// Shared Zod namespace type that exposes the common surface area used in tests.
export type ZNamespace = typeof z3 & typeof z4;
export const zodTestMatrix = [
{
zodVersionLabel: 'Zod v3',
z: z3 as ZNamespace,
isV3: true as const,
isV4: false as const
},
{
zodVersionLabel: 'Zod v4',
z: z4 as ZNamespace,
isV3: false as const,
isV4: true as const
}
] as const;
export type ZodMatrixEntry = (typeof zodTestMatrix)[number];