Genkit JS API reference
    Preparing search index...

    Class ZodObject<T, UnknownKeys, Catchall, Output, Input>

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _input: Input
    _output: Output
    _type: Output
    "~standard": Props<Input, Output>
    augment: <Augmentation extends z.ZodRawShape>(
        augmentation: Augmentation,
    ) => z.ZodObject<
        z.objectUtil.extendShape<T, Augmentation>,
        UnknownKeys,
        Catchall,
    >

    Use .extend instead

    nonstrict: () => z.ZodObject<T, "passthrough", Catchall>

    In most cases, this is no longer needed - unknown properties are now silently stripped. If you want to pass through unknown properties, use .passthrough() instead.

    spa: (
        data: unknown,
        params?: z.util.InexactPartial<z.ParseParams>,
    ) => Promise<z.SafeParseReturnType<Input, Output>>

    Alias of safeParseAsync

    create: <Shape extends z.ZodRawShape>(
        shape: Shape,
        params?: z.RawCreateParams,
    ) => z.ZodObject<
        Shape,
        "strip",
        z.ZodTypeAny,
        {
            [k in string
            | number
            | symbol]: z.objectUtil.addQuestionMarks<
                z.baseObjectOutputType<Shape>,
                any,
            >[k]
        },
        { [k in string
        | number
        | symbol]: z.baseObjectInputType<Shape>[k] },
    >
    lazycreate: <Shape extends z.ZodRawShape>(
        shape: () => Shape,
        params?: z.RawCreateParams,
    ) => z.ZodObject<Shape, "strip">
    strictCreate: <Shape extends z.ZodRawShape>(
        shape: Shape,
        params?: z.RawCreateParams,
    ) => z.ZodObject<Shape, "strict">

    Accessors

    • get description(): string | undefined

      Returns string | undefined

    • get shape(): T

      Returns T

    Methods

    • Returns { keys: string[]; shape: T }

    • Parameters

      Returns string

    • Parameters

      • data: unknown

      Returns Result<Output> | Promise<Result<Output>>

    • Parameters

      • description: string

      Returns this

    • Returns boolean

    • Returns boolean

    • Returns z.ZodEnum<CastToStringTuple<UnionToTuple<keyof T, []>>>

    • Returns z.ZodObject<
          { [k in string
          | number
          | symbol]: z.ZodOptional<T[k]> },
          UnknownKeys,
          Catchall,
      >

    • Type Parameters

      Parameters

      Returns z.ZodObject<
          {
              [k in string
              | number
              | symbol]: k extends keyof T
                  ? {
                      [k in string
                      | number
                      | symbol]: k extends keyof Mask ? z.ZodOptional<T[k]> : T[k]
                  }[k]
                  : never
          },
          UnknownKeys,
          Catchall,
      >

    • Returns z.ZodObject<
          { [k in string
          | number
          | symbol]: z.deoptional<T[k]> },
          UnknownKeys,
          Catchall,
      >

    • Type Parameters

      Parameters

      Returns z.ZodObject<
          {
              [k in string
              | number
              | symbol]: k extends keyof T
                  ? {
                      [k in string
                      | number
                      | symbol]: k extends keyof Mask ? z.deoptional<T[k]> : T[k]
                  }[k]
                  : never
          },
          UnknownKeys,
          Catchall,
      >

    • Parameters

      • Optionalmessage: ErrMessage

      Returns z.ZodObject<T, "strict", Catchall>