Skip to main content

Class: Shapes

Constructors

constructor

new Shapes()

Accessors

any

get any(): PassthroughValidator<any>

Returns

PassthroughValidator<any>

Defined in

projects/shapeshift/src/lib/Shapes.ts:63


bigInt64Array

get bigInt64Array(): TypedArrayValidator<BigInt64Array>

Returns

TypedArrayValidator<BigInt64Array>

Defined in

projects/shapeshift/src/lib/Shapes.ts:140


bigUint64Array

get bigUint64Array(): TypedArrayValidator<BigUint64Array>

Returns

TypedArrayValidator<BigUint64Array>

Defined in

projects/shapeshift/src/lib/Shapes.ts:144


bigint

get bigint(): BigIntValidator<bigint>

Returns

BigIntValidator<bigint>

Defined in

projects/shapeshift/src/lib/Shapes.ts:35


boolean

get boolean(): BooleanValidator<boolean>

Returns

BooleanValidator<boolean>

Defined in

projects/shapeshift/src/lib/Shapes.ts:39


date

get date(): DateValidator

Returns

DateValidator

Defined in

projects/shapeshift/src/lib/Shapes.ts:43


float32Array

get float32Array(): TypedArrayValidator<Float32Array>

Returns

TypedArrayValidator<Float32Array>

Defined in

projects/shapeshift/src/lib/Shapes.ts:132


float64Array

get float64Array(): TypedArrayValidator<Float64Array>

Returns

TypedArrayValidator<Float64Array>

Defined in

projects/shapeshift/src/lib/Shapes.ts:136


int16Array

get int16Array(): TypedArrayValidator<Int16Array>

Returns

TypedArrayValidator<Int16Array>

Defined in

projects/shapeshift/src/lib/Shapes.ts:116


int32Array

get int32Array(): TypedArrayValidator<Int32Array>

Returns

TypedArrayValidator<Int32Array>

Defined in

projects/shapeshift/src/lib/Shapes.ts:124


int8Array

get int8Array(): TypedArrayValidator<Int8Array>

Returns

TypedArrayValidator<Int8Array>

Defined in

projects/shapeshift/src/lib/Shapes.ts:104


never

get never(): NeverValidator

Returns

NeverValidator

Defined in

projects/shapeshift/src/lib/Shapes.ts:71


null

get null(): BaseValidator<null>

Returns

BaseValidator<null>

Defined in

projects/shapeshift/src/lib/Shapes.ts:55


nullish

get nullish(): NullishValidator

Returns

NullishValidator

Defined in

projects/shapeshift/src/lib/Shapes.ts:59


number

get number(): NumberValidator<number>

Returns

NumberValidator<number>

Defined in

projects/shapeshift/src/lib/Shapes.ts:31


string

get string(): StringValidator<string>

Returns

StringValidator<string>

Defined in

projects/shapeshift/src/lib/Shapes.ts:27


uint16Array

get uint16Array(): TypedArrayValidator<Uint16Array>

Returns

TypedArrayValidator<Uint16Array>

Defined in

projects/shapeshift/src/lib/Shapes.ts:120


uint32Array

get uint32Array(): TypedArrayValidator<Uint32Array>

Returns

TypedArrayValidator<Uint32Array>

Defined in

projects/shapeshift/src/lib/Shapes.ts:128


uint8Array

get uint8Array(): TypedArrayValidator<Uint8Array>

Returns

TypedArrayValidator<Uint8Array>

Defined in

projects/shapeshift/src/lib/Shapes.ts:108


uint8ClampedArray

get uint8ClampedArray(): TypedArrayValidator<Uint8ClampedArray>

Returns

TypedArrayValidator<Uint8ClampedArray>

Defined in

projects/shapeshift/src/lib/Shapes.ts:112


undefined

get undefined(): BaseValidator<undefined>

Returns

BaseValidator<undefined>

Defined in

projects/shapeshift/src/lib/Shapes.ts:51


unknown

get unknown(): PassthroughValidator<unknown>

Returns

PassthroughValidator<unknown>

Defined in

projects/shapeshift/src/lib/Shapes.ts:67

Methods

array

array<T>(validator): ArrayValidator<T>

Type parameters

Name
T

Parameters

NameType
validatorBaseValidator<T>

Returns

ArrayValidator<T>

Defined in

projects/shapeshift/src/lib/Shapes.ts:96


enum

enum<T>(...values): UnionValidator<T>

Type parameters

Name
T

Parameters

NameType
...valuesreadonly T[]

Returns

UnionValidator<T>

Defined in

projects/shapeshift/src/lib/Shapes.ts:75


instance

instance<T>(expected): InstanceValidator<T>

Type parameters

Name
T

Parameters

NameType
expectedConstructor<T>

Returns

InstanceValidator<T>

Defined in

projects/shapeshift/src/lib/Shapes.ts:88


literal

literal<T>(value): BaseValidator<T>

Type parameters

Name
T

Parameters

NameType
valueT

Returns

BaseValidator<T>

Defined in

projects/shapeshift/src/lib/Shapes.ts:83


map

map<T, U>(keyValidator, valueValidator): MapValidator<T, U>

Type parameters

Name
T
U

Parameters

NameType
keyValidatorBaseValidator<T>
valueValidatorBaseValidator<U>

Returns

MapValidator<T, U>

Defined in

projects/shapeshift/src/lib/Shapes.ts:160


nativeEnum

nativeEnum<T>(enumShape): NativeEnumValidator<T>

Type parameters

NameType
Textends NativeEnumLike

Parameters

NameType
enumShapeT

Returns

NativeEnumValidator<T>

Defined in

projects/shapeshift/src/lib/Shapes.ts:79


object

object<T>(shape): ObjectValidator<T>

Type parameters

Name
T

Parameters

NameType
shapeMappedObjectValidator<T>

Returns

ObjectValidator<T>

Defined in

projects/shapeshift/src/lib/Shapes.ts:47


record

record<T>(validator): RecordValidator<T>

Type parameters

Name
T

Parameters

NameType
validatorBaseValidator<T>

Returns

RecordValidator<T>

Defined in

projects/shapeshift/src/lib/Shapes.ts:156


set

set<T>(validator): SetValidator<T>

Type parameters

Name
T

Parameters

NameType
validatorBaseValidator<T>

Returns

SetValidator<T>

Defined in

projects/shapeshift/src/lib/Shapes.ts:152


tuple

tuple<T>(validators): TupleValidator<UnwrapTuple<T>>

Type parameters

NameType
Textends BaseValidator<any>[]

Parameters

NameType
validators[...T[]]

Returns

TupleValidator<UnwrapTuple<T>>

Defined in

projects/shapeshift/src/lib/Shapes.ts:148


typedArray

typedArray<T>(type?): TypedArrayValidator<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameTypeDefault value
type"Int8Array" | "Uint8Array" | "Uint8ClampedArray" | "Int16Array" | "Uint16Array" | "Int32Array" | "Uint32Array" | "Float32Array" | "Float64Array" | "BigInt64Array" | "BigUint64Array" | "TypedArray"'TypedArray'

Returns

TypedArrayValidator<T>

Defined in

projects/shapeshift/src/lib/Shapes.ts:100


union

union<T>(...validators): UnionValidator<Unwrap<T[number]>>

Type parameters

NameType
Textends BaseValidator<any>[]

Parameters

NameType
...validators[...T[]]

Returns

UnionValidator<Unwrap<T[number]>>

Defined in

projects/shapeshift/src/lib/Shapes.ts:92