Type parameters
Hierarchy
-
BaseValidator<Type,IsOptional,FieldPaths> ↳VSemantic
Constructors
constructor
• new VSemantic<Type, IsOptional, FieldPaths>(definition, isOptional, baseValidator?)
Type parameters
Parameters
Overrides
BaseValidator<Type, IsOptional, FieldPaths>.constructorProperties
type
•Readonly type: Type
Only for TypeScript, the TS type of the JS values validated
by this validator.
Inherited from
BaseValidator.typefieldPaths
•Readonly fieldPaths: FieldPaths
Only for TypeScript, if this an Object validator, then
this is the TS type of its property names.
Inherited from
BaseValidator.fieldPathsisOptional
•Readonly isOptional: IsOptional
Whether this is an optional Object property value validator.
Inherited from
BaseValidator.isOptionalisConvexValidator
•Readonly isConvexValidator: true
Always "true".
Inherited from
BaseValidator.isConvexValidatorkind
•Readonly kind: "semantic"
baseValidator
•Optional Readonly baseValidator: Validator<any, "required", any>
Accessors
json
•get json(): ValidatorJSON
Returns
ValidatorJSON
Overrides
BaseValidator.jsonMethods
parse
▸ parse(value): Type
Parameters
Returns
Type
safeParse
▸ safeParse(value): { success: true ; data: Type } | { success: false ; error: SemanticValueError }
Parameters
Returns
{success: true ; data: Type } | { success: false ; error: SemanticValueError }
optional
▸ optional():VSemantic<Type | undefined, "optional", FieldPaths>
Returns
VSemantic<Type | undefined, "optional", FieldPaths>
Overrides
BaseValidator.optionalasOptional
▸ asOptional():VSemantic<undefined | Type, "optional", FieldPaths>
Returns
VSemantic<undefined | Type, "optional", FieldPaths>
Overrides
BaseValidator.asOptionalrequired
▸ required():VSemantic<Exclude<Type, undefined>, "required", FieldPaths>
Retain the domain contract and native file metadata when requiring a value.
Returns
VSemantic<Exclude<Type, undefined>, "required", FieldPaths>