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

Type Parameters

Hierarchy (view full)

Constructors

Properties

_cached: any
_input: Input
_output: Output
_type: Output
augment: (<Augmentation>(augmentation) => ZodObject<{
    [k in string | number | symbol]: (Omit<T, keyof Augmentation> & Augmentation)[k]
}, UnknownKeys, Catchall, objectOutputType<{
    [k in string | number | symbol]: (Omit<T, keyof Augmentation> & Augmentation)[k]
}, Catchall, UnknownKeys>, objectInputType<{
    [k in string | number | symbol]: (Omit<T, keyof Augmentation> & Augmentation)[k]
}, Catchall, UnknownKeys>>)

Type declaration

Deprecated

Use .extend instead

nonstrict: (() => ZodObject<T, "passthrough", Catchall, objectOutputType<T, Catchall, "passthrough">, objectInputType<T, Catchall, "passthrough">>)

Type declaration

Deprecated

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, params?) => Promise<SafeParseReturnType<Input, Output>>)

Alias of safeParseAsync

Type declaration

create: (<T_1>(shape, params?) => ZodObject<T_1, "strip", ZodTypeAny, {
    [k_1 in string | number | symbol]: addQuestionMarks<baseObjectOutputType<T_1>, {
        [k in string | number | symbol]: undefined extends baseObjectOutputType<T_1>[k]
            ? never
            : k
    }[keyof T_1]>[k_1]
}, {
    [k_2 in string | number | symbol]: baseObjectInputType<T_1>[k_2]
}>)

Type declaration

lazycreate: (<T_1>(shape, params?) => ZodObject<T_1, "strip", ZodTypeAny, {
    [k_1 in string | number | symbol]: addQuestionMarks<baseObjectOutputType<T_1>, {
        [k in string | number | symbol]: undefined extends baseObjectOutputType<T_1>[k]
            ? never
            : k
    }[keyof T_1]>[k_1]
}, {
    [k_2 in string | number | symbol]: baseObjectInputType<T_1>[k_2]
}>)

Type declaration

strictCreate: (<T_1>(shape, params?) => ZodObject<T_1, "strict", ZodTypeAny, {
    [k_1 in string | number | symbol]: addQuestionMarks<baseObjectOutputType<T_1>, {
        [k in string | number | symbol]: undefined extends baseObjectOutputType<T_1>[k]
            ? never
            : k
    }[keyof T_1]>[k_1]
}, {
    [k_2 in string | number | symbol]: baseObjectInputType<T_1>[k_2]
}>)

Type declaration

Accessors

  • get description(): undefined | string
  • Returns undefined | string

  • get shape(): T
  • Returns T

Methods

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

    • keys: string[]
    • shape: T
  • Parameters

    Returns string

  • Parameters

    • description: string

    Returns this

  • Returns boolean

  • Returns boolean

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

  • Type Parameters

    • Mask extends {
          [k in string | number | symbol]?: true
      }

    Parameters

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

Generated using TypeDoc