intersection()
intersection<
S1,S2>(schema1,schema2,message?):IntersectionSchema<readonly [S1,S2]>
Intersection schema - validates that the value satisfies multiple schemas.
Type Parametersβ
S1: S1 extends GenericSchemaβ
S2: S2 extends GenericSchemaβ
Parametersβ
schema1: S1β
First schema.
schema2: S2β
Second schema.
message?: stringβ
Custom error message.
Returns: IntersectionSchema<readonly [S1, S2]>β
Schema that validates the intersection of both schemas.
Sinceβ
2.0.0