@creator.co/wapi - v1.8.2
    Preparing search index...

    Validates the given data against the provided schema.

    The data to be validated.

    The schema to validate against.

    • Returns true if the data is valid, otherwise returns a response object with an error message.
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Validates the given data against the provided schema.

      Parameters

      • data: any

        The data to be validated.

      • schema:
            | ZodObject<
                any,
                UnknownKeysParam,
                ZodTypeAny,
                { [key: string]: any },
                { [key: string]: any },
            >
            | ZodUnion<any>
            | ZodIntersection<any, any>

        The schema to validate against.

      Returns boolean | default<ResponseErrorType>

      • Returns either true if the data is valid or a Response object with an error message if validation fails.