Home > @websublime/schema > ArraySchemaType

ArraySchemaType class

Array model type validation

Signature:

export declare class ArraySchemaType<T> extends BaseSchemaType<Array<T>> 

Extends: BaseSchemaType<Array<T>>

Constructors

ConstructorModifiersDescription
(constructor)(items, errorMessage)Create ArraySchemaType instance

Properties

PropertyModifiersTypeDescription
itemsInferSchemaType<T> | nullitems model type
typestring

Methods

MethodModifiersDescription
check(values, parent, context, drill)Validate array
maxLength(maxLength, errorMessage)Test array maximum length
minLength(minLength, errorMessage)Test array minimum length
of(items)Set items model type
rangeLength(minLength, maxLength, errorMessage)Test if array length is between range