Skip to content

how to handle "[key: string]: any" combined with specific keys #400

Closed Answered by fabian-hiller
aboveyunhai asked this question in Q&A
Discussion options

You must be logged in to vote

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()
);

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@fabian-hiller
Comment options

@aboveyunhai
Comment options

Answer selected by fabian-hiller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants