Skip to main content

Class: NeverValidator

Hierarchy

Constructors

constructor

new NeverValidator(constraints?)

Parameters

NameTypeDefault value
constraintsreadonly IConstraint<never, never>[][]

Inherited from

BaseValidator.constructor

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:17

Properties

constraints

Protected constraints: readonly IConstraint<never, never>[] = []

Inherited from

BaseValidator.constraints

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:14


isValidationEnabled

Protected isValidationEnabled: null | boolean | () => boolean = null

Inherited from

BaseValidator.isValidationEnabled

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:15

Accessors

array

get array(): ArrayValidator<T[], T>

Returns

ArrayValidator<T[], T>

Inherited from

BaseValidator.array

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:33


nullable

get nullable(): UnionValidator<null | T>

Returns

UnionValidator<null | T>

Inherited from

BaseValidator.nullable

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:25


nullish

get nullish(): UnionValidator<undefined | null | T>

Returns

UnionValidator<undefined | null | T>

Inherited from

BaseValidator.nullish

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:29


optional

get optional(): UnionValidator<undefined | T>

Returns

UnionValidator<undefined | T>

Inherited from

BaseValidator.optional

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:21


set

get set(): SetValidator<T>

Returns

SetValidator<T>

Inherited from

BaseValidator.set

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:37


shouldRunConstraints

Protected get shouldRunConstraints(): boolean

Returns

boolean

Inherited from

BaseValidator.shouldRunConstraints

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:98

Methods

addConstraint

Protected addConstraint(constraint): NeverValidator

Parameters

NameType
constraintIConstraint<never, never>

Returns

NeverValidator

Inherited from

BaseValidator.addConstraint

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:110


clone

Protected clone(): NeverValidator

Returns

NeverValidator

Inherited from

BaseValidator.clone

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:102


default

default(value): DefaultValidator<never>

Parameters

NameType
value() => never

Returns

DefaultValidator<never>

Inherited from

BaseValidator.default

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:57


getValidationEnabled

getValidationEnabled(): null | boolean

Returns

null | boolean

Inherited from

BaseValidator.getValidationEnabled

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:94


handle

Protected handle(value): Result<never, ValidationError>

Parameters

NameType
valueunknown

Returns

Result<never, ValidationError>

Overrides

BaseValidator.handle

Defined in

projects/shapeshift/src/validators/NeverValidator.ts:6


or

or<O>(...predicates): UnionValidator<O>

Type parameters

Name
O

Parameters

NameType
...predicatesreadonly BaseValidator<O>[]

Returns

UnionValidator<O>

Inherited from

BaseValidator.or

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:41


parse

parse<R>(value): R

Type parameters

NameType
Rextends never = never

Parameters

NameType
valueunknown

Returns

R

Inherited from

BaseValidator.parse

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:73


reshape

reshape(cb): NeverValidator

Parameters

NameType
cb(input: never) => Result<never, Error>

Returns

NeverValidator

Inherited from

BaseValidator.reshape

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:51

reshape<R, O>(cb): BaseValidator<O>

Type parameters

NameType
Rextends Result<unknown, Error, R>
OInferResultType<R>

Parameters

NameType
cb(input: never) => R

Returns

BaseValidator<O>

Inherited from

BaseValidator.reshape

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:52


run

run(value): Result<never, BaseError>

Parameters

NameType
valueunknown

Returns

Result<never, BaseError>

Inherited from

BaseValidator.run

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:61


setValidationEnabled

setValidationEnabled(isValidationEnabled): NeverValidator

Parameters

NameTypeDescription
isValidationEnablednull | boolean | () => boolean

Returns

NeverValidator

Inherited from

BaseValidator.setValidationEnabled

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:88


transform

transform(cb): NeverValidator

Parameters

NameType
cb(value: never) => never

Returns

NeverValidator

Inherited from

BaseValidator.transform

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:45

transform<O>(cb): BaseValidator<O>

Type parameters

Name
O

Parameters

NameType
cb(value: never) => O

Returns

BaseValidator<O>

Inherited from

BaseValidator.transform

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:46