Skip to main content

Class: DateValidator

Hierarchy

Constructors

constructor

new DateValidator(constraints?)

Parameters

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

Inherited from

BaseValidator.constructor

Defined in

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

Properties

constraints

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

Inherited from

BaseValidator.constraints

Defined in

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

Accessors

array

get array(): ArrayValidator<T>

Returns

ArrayValidator<T>

Inherited from

BaseValidator.array

Defined in

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


invalid

get invalid(): this

Returns

this

Defined in

projects/shapeshift/src/validators/DateValidator.ts:50


nullable

get nullable(): UnionValidator<null | T>

Returns

UnionValidator<null | T>

Inherited from

BaseValidator.nullable

Defined in

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


nullish

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

Returns

UnionValidator<undefined | null | T>

Inherited from

BaseValidator.nullish

Defined in

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


optional

get optional(): UnionValidator<undefined | T>

Returns

UnionValidator<undefined | T>

Inherited from

BaseValidator.optional

Defined in

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


set

get set(): SetValidator<T>

Returns

SetValidator<T>

Inherited from

BaseValidator.set

Defined in

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


valid

get valid(): this

Returns

this

Defined in

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

Methods

addConstraint

Protected addConstraint(constraint): DateValidator

Parameters

NameType
constraintIConstraint<Date, Date>

Returns

DateValidator

Inherited from

BaseValidator.addConstraint

Defined in

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


clone

Protected clone(): DateValidator

Returns

DateValidator

Inherited from

BaseValidator.clone

Defined in

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


default

default(value): DefaultValidator<Date>

Parameters

NameType
valueDate | () => Date

Returns

DefaultValidator<Date>

Inherited from

BaseValidator.default

Defined in

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


equal

equal(date): DateValidator

Parameters

NameType
datestring | number | Date

Returns

DateValidator

Defined in

projects/shapeshift/src/validators/DateValidator.ts:32


greaterThan

greaterThan(date): DateValidator

Parameters

NameType
datestring | number | Date

Returns

DateValidator

Defined in

projects/shapeshift/src/validators/DateValidator.ts:24


greaterThanOrEqual

greaterThanOrEqual(date): DateValidator

Parameters

NameType
datestring | number | Date

Returns

DateValidator

Defined in

projects/shapeshift/src/validators/DateValidator.ts:28


handle

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

Parameters

NameType
valueunknown

Returns

Result<Date, ValidationError>

Overrides

BaseValidator.handle

Defined in

projects/shapeshift/src/validators/DateValidator.ts:54


lessThan

lessThan(date): DateValidator

Parameters

NameType
datestring | number | Date

Returns

DateValidator

Defined in

projects/shapeshift/src/validators/DateValidator.ts:16


lessThanOrEqual

lessThanOrEqual(date): DateValidator

Parameters

NameType
datestring | number | Date

Returns

DateValidator

Defined in

projects/shapeshift/src/validators/DateValidator.ts:20


notEqual

notEqual(date): DateValidator

Parameters

NameType
datestring | number | Date

Returns

DateValidator

Defined in

projects/shapeshift/src/validators/DateValidator.ts:39


or

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

Type parameters

Name
O

Parameters

NameType
...predicatesreadonly BaseValidator<O>[]

Returns

UnionValidator<Date | O>

Inherited from

BaseValidator.or

Defined in

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


parse

parse(value): Date

Parameters

NameType
valueunknown

Returns

Date

Inherited from

BaseValidator.parse

Defined in

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


run

run(value): Result<Date, BaseError>

Parameters

NameType
valueunknown

Returns

Result<Date, BaseError>

Inherited from

BaseValidator.run

Defined in

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


transform

transform(cb): DateValidator

Parameters

NameType
cb(value: Date) => Date

Returns

DateValidator

Inherited from

BaseValidator.transform

Defined in

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

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

Type parameters

Name
O

Parameters

NameType
cb(value: Date) => O

Returns

BaseValidator<O>

Inherited from

BaseValidator.transform

Defined in

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