• This function validates the given object by the given constraints, and returns an error that uses the given context if needed.

    Type Parameters

    • T

    Parameters

    • constraints: Partial<Record<keyof T, Constraint>>

      This is the keys of the object with specified values for validation.

    • context: string

      Object type name for error context purposes.

    • Rest...object: any

      The given object type, an array of or only a single object, to be validated.

    Returns void

    throws a Zod Error if validations are broken.