Class: VObject<Type, Fields, IsOptional, FieldPaths>
values.VObject
The type of the v.object() validator.
Type parameters
| Name | Type |
|---|---|
Type | Type |
Fields | extends Record<string, GenericValidator> |
IsOptional | extends OptionalProperty = "required" |
FieldPaths | extends string = { [Property in keyof Fields]: JoinFieldPaths<Property & string, Fields[Property]["fieldPaths"]> | Property }[keyof Fields] & string |
Hierarchy
-
BaseValidator<Type,IsOptional,FieldPaths>↳
VObject
Constructors
constructor
• new VObject<Type, Fields, IsOptional, FieldPaths>(«destructured»)
Usually you'd use v.object({ ... }) instead.
Type parameters
| Name | Type |
|---|---|
Type | Type |
Fields | extends Record<string, GenericValidator> |
IsOptional | extends OptionalProperty = "required" |
FieldPaths | extends string = { [Property in string | number | symbol]: Property | `${Property & string}.${Fields[Property]["fieldPaths"]}` }[keyof Fields] & string |
Parameters
| Name | Type |
|---|---|
«destructured» | Object |
› isOptional | IsOptional |
› fields | Fields |
Overrides
BaseValidator<Type, IsOptional, FieldPaths>.constructor
Defined in
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
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
isOptional
• Readonly isOptional: IsOptional
Whether this is an optional Object property value validator.
Inherited from
BaseValidator.isOptional
Defined in
isConvexValidator
• Readonly isConvexValidator: true
Always "true".
Inherited from
BaseValidator.isConvexValidator
Defined in
fields
• Readonly fields: Fields
An object with the validator for each property.
Defined in
kind
• Readonly kind: "object"
The kind of validator, "object".
Defined in
Accessors
optional
• get optional(): boolean
Deprecated
- use isOptional instead
Returns
boolean
Inherited from
BaseValidator.optional