how to handle "[key: string]: any" combined with specific keys #400
-
how to handle this typescript case in valibot, I search the doc and didn't find an answer. type Test {
specific?: string;
[key: string]: any;
} since |
Beta Was this translation helpful? Give feedback.
Answered by
fabian-hiller
Jan 30, 2024
Replies: 1 comment 2 replies
-
Thank you for using Valibot! Here is the solution. You can read more about it in the docs: https://valibot.dev/guides/objects/ import * as v from 'valibot';
const TestSchema = v.object(
{ specific: v.optional(v.string()) },
v.any()
); |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
fabian-hiller
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for using Valibot! Here is the solution. You can read more about it in the docs: https://valibot.dev/guides/objects/