Table of contents

Public class

Signature
class UnionValidator<
  Key extends string,
  Config extends UnionValidatorConfig<Key, Config>,
  UnknownValue = never,
> extends Validator<TypeOf<Config[keyof Config]> | UnknownValue> {}
References

Validator, TypeOf

Source

packages/validate/src/lib/validation.ts


Constructor

Public constructor

Constructs a new instance of the UnionValidator class

Parameters
NameDescription

key

Key

config

Config

unknownValueValidation

(
  value: object,
  variant: string
) => UnknownValue

Methods

validateUnknownVariants()

Public method

Signature
validateUnknownVariants<Unknown>(
  unknownValueValidation: (value: object, variant: string) => Unknown
): UnionValidator<Key, Config, Unknown>
Parameters
NameDescription

unknownValueValidation

(value: object, variant: string) => Unknown
Returns
UnionValidator<Key, Config, Unknown>
References

UnionValidator


TValidator