-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
Calling isOptional
triggers preprocess callback.
Related to StefanTerdell/zod-to-json-schema#23.
Here's a failing test case:
test("calling isOptional should not trigger preprocess function", () => {
let wasCalled = false;
const pre = z.preprocess(() => {
wasCalled = true;
}, z.string());
pre.isOptional();
expect(wasCalled).toBe(false);
});
dearlordylord, jedwards1211 and Creative-Difficulty
Metadata
Metadata
Assignees
Labels
No labels