-
-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Description
Similar to #1468 where spreading drops .narrow(), calling .partial() also silently drops it.
Reproduction
import { type } from "arktype";
const User = type({ name: "string", email: "string" })
.narrow((u) => u.email.includes("@"));
User({ name: "Yi", email: "bad" }); // ✗ rejected (correct)
const PatchUser = User.partial();
PatchUser({ email: "bad" }); // ✓ accepted — narrow is goneExpected
Should either preserve the narrow or throw if it can't. As a quick fix, throwing when .partial() is applied to a narrowed/filtered schema would at least make the issue visible — similar to how Zod handles .partial() on refined schemas.
Environment
- arktype 2.2.x
- Node 22
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
To do