Skip to content

arrayValidator

arrayValidator<TCollectionSlug, TArrayType>(slug, fn): FieldValidate<TCollectionSlug, TArrayType[]>

Defined in: packages/core/src/fields/array/validator.ts:63

Types an array() field’s validate() against a real collection and DataModel, with value fixed to TArrayType[].

TCollectionSlug extends string

TArrayType extends ArrayType = string

TCollectionSlug

The owning collection’s slug, used only to infer TCollectionSlug.

FieldValidate<TCollectionSlug, TArrayType[], ArrayField<string, TArrayType, BaseFieldMeta>>

The validate callback, checked against the collection’s real document shape and value type.

FieldValidate<TCollectionSlug, TArrayType[]>

The same function, re-typed to the field’s loose public validate signature.

fieldValidator