Libraries
    Preparing search index...

    Function intersection

    • Creates an intersection schema. The resulting schema validates that the input satisfies both left and right schemas.

      Type Parameters

      Parameters

      Returns IntersectionSchemaBuilder<TLeft, TRight, true, false, undefined, false, {}>

      const schema = intersection(
      object({ name: string() }),
      object({ age: number() })
      );
      // InferType<typeof schema> === { name: string } & { age: number }