Skip to content

isFieldConditionMet

isFieldConditionMet(props): boolean

Defined in: packages/core/src/fields/utils.ts:350

Evaluates whether a field’s admin.condition is currently met. A field with no condition is always met. A condition that throws counts as met — the failure must be visible elsewhere, never a silent validation skip.

field.admin.condition is declared via method shorthand (bivariant — see baseTypes.ts’s FieldAdminConfigInput), nominally typed against whatever TCollectionSlug the field was authored with. This function operates on live run-time data/siblingData (Record<string, unknown>, not a nominal document type), so it casts the condition to that plain shape before calling it — the exact same escape hatch validateFields already uses for field.validate in fields/utils.ts.

Record<string, unknown>

AdminField

Record<string, unknown>

boolean

true if the field has no condition, or if its condition evaluates (or throws) to a met state; false otherwise.