Skip to main content

Class: Validator<TypeScriptType, IsOptional, FieldPaths>

values.Validator

A validator for a Convex value.

This should be constructed using the validator builder, v.

This class encapsulates:

  • The TypeScript type of this value.
  • Whether this field should be optional if it's included in an object.
  • The TypeScript type for the set of index field paths that can be used to build indexes on this value.
  • A JSON representation of the validator.

Type parameters

NameType
TypeScriptTypeTypeScriptType
IsOptionalextends boolean = false
FieldPathsextends string = never

Properties

type

Readonly type: TypeScriptType

Defined in

values/validator.ts:22


isOptional

Readonly isOptional: IsOptional

Defined in

values/validator.ts:23


fieldPaths

Readonly fieldPaths: FieldPaths

Defined in

values/validator.ts:24


_isValidator

Readonly _isValidator: undefined

Defined in

values/validator.ts:27


optional

Readonly optional: boolean

Defined in

values/validator.ts:29