Creates an intersection schema. The resulting schema validates that the input satisfies both left and right schemas.
left
right
first schema
second schema
const schema = intersection( object({ name: string() }), object({ age: number() }));// InferType<typeof schema> === { name: string } & { age: number } Copy
const schema = intersection( object({ name: string() }), object({ age: number() }));// InferType<typeof schema> === { name: string } & { age: number }
Creates an intersection schema. The resulting schema validates that the input satisfies both
leftandrightschemas.