Replies: 1 comment
-
|
It is not marked as deprecated anymore: zod/packages/zod/src/v4/core/errors.ts Lines 178 to 179 in ae68f62 Also, it is no longer described as internal use only, and it is used in the docs for const UniqueStringArray = z.array(z.string()).check((ctx) => {
if (ctx.value.length > 3) {
// full control of issue objects
ctx.issues.push({
code: "too_big",
maximum: 3,
origin: "array",
inclusive: true,
message: "Too many items 😡",
input: ctx.value
});
}
// create multiple issues in one refinement
if (ctx.value.length !== new Set(ctx.value).size) {
ctx.issues.push({
code: "custom",
message: `No duplicates allowed.`,
input: ctx.value,
continue: true // make this issue continuable (default: false)
});
}
});So, it should be fine to use it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So I am v4 confused.
I have the following two schemas that work together to validate a signup form. Note the use of the two
checkmethods and thecontinueproperties on thepasswordSchema:This works fine, but
continueis marked as deprecated now:zod/packages/zod/src/v4/core/errors.ts
Lines 165 to 166 in 499df78
Without this, the check for the confirmation password just doesn't run at all.
So my question is, as
continueis deprecated, how am I supposed to make sure the secondcheckis called? Obviously I can just continue to usecontinue, but it must have been deprecated for a reason?Skill issue for sure.. 😄
Beta Was this translation helpful? Give feedback.
All reactions