SIGN IN SIGN UP

Widen literal inputs in property check types (#6520)

* Widen literal inputs in property check types

`z.property("protocol", z.literal("https:"))` on a `URL` failed to compile because the check was typed over `{ protocol: "https:" }`, and a `string` property is not assignable to that. Every literal, enum or boolean property check therefore needed an `as string` / `as boolean` cast, which is what the docs showed.

The check is now typed over the widened input of its schema — `"https:"` becomes `string`, `false` becomes `boolean` — so those calls compile as written. A genuine mismatch (`z.property("length", z.string())` on a string) and an unknown key still fail to compile; both are pinned in the test. Type-only change: no runtime, memory or bundle impact.

Drops the now-unneeded casts from the docs, the blog post and the tests.

* Pin the input-side typing of property checks and the singular literal case

* Keep the @ts-expect-error on the line that fails
C
Colin McDonnell committed
68a609ac9b9516e6fe84e3558f17ce16b1032bef
Parent: 0227e53
Committed by GitHub <noreply@github.com> on 8/31/2026, 6:59:09 PM