Skip to main content

$intersection

Callable

  • $intersection<Elements>(intersection: Elements, options?: SchemaOptions<object, UnionToIntersection<Elements[number][infer]>>): IntersectionType<Elements>

  • Create a new IntersectionType instance with the given options.

    Example

    $intersection([$object({foo: $integer}), $object({bar: $string}])

    Type parameters

    Parameters

    • intersection: Elements

      The items in the intersection.

    • options: SchemaOptions<object, UnionToIntersection<Elements[number][infer]>> = {}

      Additional options to pass to the tuple.

    Returns IntersectionType<Elements>