Skip to main content

Class: BigIntValidator<T>

Type parameters

NameType
Textends bigint

Hierarchy

Constructors

constructor

new BigIntValidator<T>(constraints?)

Type parameters

NameType
Textends bigint

Parameters

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

Inherited from

BaseValidator.constructor

Defined in

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

Properties

constraints

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

Inherited from

BaseValidator.constraints

Defined in

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


isValidationEnabled

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

Inherited from

BaseValidator.isValidationEnabled

Defined in

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

Accessors

abs

get abs(): this

Returns

this

Defined in

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


array

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

Returns

ArrayValidator<T[], T>

Inherited from

BaseValidator.array

Defined in

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


negative

get negative(): this

Returns

this

Defined in

projects/shapeshift/src/validators/BigIntValidator.ts:44


nullable

get nullable(): UnionValidator<null | T>

Returns

UnionValidator<null | T>

Inherited from

BaseValidator.nullable

Defined in

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


nullish

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

Returns

UnionValidator<undefined | null | T>

Inherited from

BaseValidator.nullish

Defined in

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


optional

get optional(): UnionValidator<undefined | T>

Returns

UnionValidator<undefined | T>

Inherited from

BaseValidator.optional

Defined in

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


positive

get positive(): this

Returns

this

Defined in

projects/shapeshift/src/validators/BigIntValidator.ts:40


set

get set(): SetValidator<T>

Returns

SetValidator<T>

Inherited from

BaseValidator.set

Defined in

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


shouldRunConstraints

Protected get shouldRunConstraints(): boolean

Returns

boolean

Inherited from

BaseValidator.shouldRunConstraints

Defined in

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

Methods

addConstraint

Protected addConstraint(constraint): BigIntValidator<T>

Parameters

NameType
constraintIConstraint<T, T>

Returns

BigIntValidator<T>

Inherited from

BaseValidator.addConstraint

Defined in

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


clone

Protected clone(): BigIntValidator<T>

Returns

BigIntValidator<T>

Inherited from

BaseValidator.clone

Defined in

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


default

default(value): DefaultValidator<Exclude<T, undefined>>

Parameters

NameType
valueExclude<T, undefined> | () => Exclude<T, undefined>

Returns

DefaultValidator<Exclude<T, undefined>>

Inherited from

BaseValidator.default

Defined in

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


divisibleBy

divisibleBy(number): BigIntValidator<T>

Parameters

NameType
numberbigint

Returns

BigIntValidator<T>

Defined in

projects/shapeshift/src/validators/BigIntValidator.ts:48


equal

equal<N>(number): BigIntValidator<N>

Type parameters

NameType
Nextends bigint

Parameters

NameType
numberN

Returns

BigIntValidator<N>

Defined in

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


getValidationEnabled

getValidationEnabled(): null | boolean

Returns

null | boolean

Inherited from

BaseValidator.getValidationEnabled

Defined in

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


greaterThan

greaterThan(number): BigIntValidator<T>

Parameters

NameType
numberbigint

Returns

BigIntValidator<T>

Defined in

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


greaterThanOrEqual

greaterThanOrEqual(number): BigIntValidator<T>

Parameters

NameType
numberbigint

Returns

BigIntValidator<T>

Defined in

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


handle

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

Parameters

NameType
valueunknown

Returns

Result<T, ValidationError>

Overrides

BaseValidator.handle

Defined in

projects/shapeshift/src/validators/BigIntValidator.ts:64


intN

intN(bits): BigIntValidator<T>

Parameters

NameType
bitsnumber

Returns

BigIntValidator<T>

Defined in

projects/shapeshift/src/validators/BigIntValidator.ts:56


lessThan

lessThan(number): BigIntValidator<T>

Parameters

NameType
numberbigint

Returns

BigIntValidator<T>

Defined in

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


lessThanOrEqual

lessThanOrEqual(number): BigIntValidator<T>

Parameters

NameType
numberbigint

Returns

BigIntValidator<T>

Defined in

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


notEqual

notEqual(number): BigIntValidator<T>

Parameters

NameType
numberbigint

Returns

BigIntValidator<T>

Defined in

projects/shapeshift/src/validators/BigIntValidator.ts:36


or

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

Type parameters

Name
O

Parameters

NameType
...predicatesreadonly BaseValidator<O>[]

Returns

UnionValidator<T | O>

Inherited from

BaseValidator.or

Defined in

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


parse

parse<R>(value): R

Type parameters

NameType
Rextends bigint = T

Parameters

NameType
valueunknown

Returns

R

Inherited from

BaseValidator.parse

Defined in

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


run

run(value): Result<T, BaseError>

Parameters

NameType
valueunknown

Returns

Result<T, BaseError>

Inherited from

BaseValidator.run

Defined in

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


setValidationEnabled

setValidationEnabled(isValidationEnabled): BigIntValidator<T>

Parameters

NameTypeDescription
isValidationEnablednull | boolean | () => boolean

Returns

BigIntValidator<T>

Inherited from

BaseValidator.setValidationEnabled

Defined in

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


transform

transform(cb): BigIntValidator<T>

Parameters

NameType
cb(value: T) => T

Returns

BigIntValidator<T>

Inherited from

BaseValidator.transform

Defined in

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

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

Type parameters

Name
O

Parameters

NameType
cb(value: T) => O

Returns

BaseValidator<O>

Inherited from

BaseValidator.transform

Defined in

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


uintN

uintN(bits): BigIntValidator<T>

Parameters

NameType
bitsnumber

Returns

BigIntValidator<T>

Defined in

projects/shapeshift/src/validators/BigIntValidator.ts:60