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