Skip to main content

Function: validateMonitorField()

validateMonitorField<TType, TField>(type: TType, fieldName: TField, value: MaybeUndefined<MonitorFieldValue<TType, TField>>): Promise<readonly string[]>

Defined in: src/utils/monitorValidation.ts:413

Validate individual monitor field with improved error filtering.

Type Parametersโ€‹

TTypeโ€‹

TType extends "http" | "http-keyword" | "http-status" | "http-header" | "http-json" | "http-latency" | "port" | "ping" | "dns" | "ssl" | "websocket-keepalive" | "server-heartbeat" | "replication" | "cdn-edge-consistency"

Monitor type under validation.

TFieldโ€‹

TField extends string

Field identifier belonging to the monitor form.

Parametersโ€‹

typeโ€‹

TType

Monitor type.

fieldNameโ€‹

TField

Field name to validate.

valueโ€‹

MaybeUndefined<MonitorFieldValue<TType, TField>>

Field value.

Returnsโ€‹

Promise<readonly string[]>

Promise resolving to validation errors (empty when valid).