Skip to main content

Class: VRecord<Type, Key, Value, IsOptional, FieldPaths>

values.VRecord

The type of the v.record() validator.

Type parameters

NameType
TypeType
Keyextends Validator<string, "required", any>
Valueextends Validator<any, "required", any>
IsOptionalextends OptionalProperty = "required"
FieldPathsextends string = string

Hierarchy

  • BaseValidator<Type, IsOptional, FieldPaths>

    VRecord

Constructors

constructor

new VRecord<Type, Key, Value, IsOptional, FieldPaths>(«destructured»)

Usually you'd use v.record(key, value) instead.

Type parameters

NameType
TypeType
Keyextends Validator<string, "required", any>
Valueextends Validator<any, "required", any>
IsOptionalextends OptionalProperty = "required"
FieldPathsextends string = string

Parameters

NameType
«destructured»Object
› isOptionalIsOptional
› keyKey
› valueValue

Overrides

BaseValidator&lt;Type, IsOptional, FieldPaths&gt;.constructor

Defined in

values/validators.ts:438

Properties

type

Readonly type: Type

Only for TypeScript, the TS type of the JS values validated by this validator.

Inherited from

BaseValidator.type

Defined in

values/validators.ts:21


fieldPaths

Readonly fieldPaths: FieldPaths

Only for TypeScript, if this an Object validator, then this is the TS type of its property names.

Inherited from

BaseValidator.fieldPaths

Defined in

values/validators.ts:26


isOptional

Readonly isOptional: IsOptional

Whether this is an optional Object property value validator.

Inherited from

BaseValidator.isOptional

Defined in

values/validators.ts:31


isConvexValidator

Readonly isConvexValidator: true

Always "true".

Inherited from

BaseValidator.isConvexValidator

Defined in

values/validators.ts:36


key

Readonly key: Key

The validator for the keys of the record.

Defined in

values/validators.ts:423


value

Readonly value: Value

The validator for the values of the record.

Defined in

values/validators.ts:428


kind

Readonly kind: "record"

The kind of validator, "record".

Defined in

values/validators.ts:433

Accessors

optional

get optional(): boolean

Deprecated

  • use isOptional instead

Returns

boolean

Inherited from

BaseValidator.optional

Defined in

values/validators.ts:43