Getting error when using v.merge
with v.object
and v.record
#486
-
Hi 👋 I used this site https://sinclairzx81.github.io/typebox-workbench Input: export type T = {
layouts?: {
default?: string
} & Record<string, string>
} Output: import * as v from 'valibot'
export type T = v.Output<typeof T>
export const T = v.object({
layouts: v.optional(
v.merge([
v.object({
default: v.optional(v.string())
}),
v.record(v.string())
// ^^^^^^^^^^^^^^^^^ ERROR
])
)
}) Error:
|
Beta Was this translation helpful? Give feedback.
Answered by
fabian-hiller
Mar 19, 2024
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
babakfp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
merge
does only work withobject
. Please have a look at this guide: https://valibot.dev/guides/intersections/