We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Originally posted by zbeyens February 3, 2024 I'm trying to derive a field from another field using .transform to avoid using a separate hook.
.transform
skill: defineRoute('/@[username]/s/[skillTitleId]', { // error params: z .object({ skillTitleId: z.string(), username: z.string().transform((v) => v.slice(3)), }) .transform((v) => ({ ...v, skillId: getTitleUrlId(v.skillTitleId), })),
Using this, I'm getting
TS2740: Type ZodEffects<ZodObject<{ skillId: ZodOptional; skillTitleId: ZodString; username: ZodEffects<ZodString, string, string>; }, "strip", ZodTypeAny, { ...; }, { ...; }>, { ...; }, { ...; }> is missing the following properties from type ZodObject<{ username: ZodType<any, ZodTypeDef, any>; skillTitleId: ZodType<any, ZodTypeDef, any>; }, UnknownKeysParam, ZodTypeAny, { ...; }, { ...; }> : _cached, _getCached, shape, strict, and 14 more.
Would this be supported in some way?
The text was updated successfully, but these errors were encountered:
lukemorales
No branches or pull requests
Discussed in #3
Originally posted by zbeyens February 3, 2024
I'm trying to derive a field from another field using
.transform
to avoid using a separate hook.Using this, I'm getting
Would this be supported in some way?
The text was updated successfully, but these errors were encountered: