Skip to main content

Class: Shapes

Constructors

constructor

new Shapes(): Shapes

Returns

Shapes

Accessors

any

get any(): PassthroughValidator<any>

Returns

PassthroughValidator<any>

Defined in

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


bigInt64Array

get bigInt64Array(): TypedArrayValidator<BigInt64Array>

Returns

TypedArrayValidator<BigInt64Array>

Defined in

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


bigUint64Array

get bigUint64Array(): TypedArrayValidator<BigUint64Array>

Returns

TypedArrayValidator<BigUint64Array>

Defined in

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


bigint

get bigint(): BigIntValidator<bigint>

Returns

BigIntValidator<bigint>

Defined in

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


boolean

get boolean(): BooleanValidator<boolean>

Returns

BooleanValidator<boolean>

Defined in

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


date

get date(): DateValidator

Returns

DateValidator

Defined in

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


float32Array

get float32Array(): TypedArrayValidator<Float32Array>

Returns

TypedArrayValidator<Float32Array>

Defined in

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


float64Array

get float64Array(): TypedArrayValidator<Float64Array>

Returns

TypedArrayValidator<Float64Array>

Defined in

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


int16Array

get int16Array(): TypedArrayValidator<Int16Array>

Returns

TypedArrayValidator<Int16Array>

Defined in

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


int32Array

get int32Array(): TypedArrayValidator<Int32Array>

Returns

TypedArrayValidator<Int32Array>

Defined in

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


int8Array

get int8Array(): TypedArrayValidator<Int8Array>

Returns

TypedArrayValidator<Int8Array>

Defined in

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


never

get never(): NeverValidator

Returns

NeverValidator

Defined in

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


null

get null(): BaseValidator<null>

Returns

BaseValidator<null>

Defined in

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


nullish

get nullish(): NullishValidator

Returns

NullishValidator

Defined in

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


number

get number(): NumberValidator<number>

Returns

NumberValidator<number>

Defined in

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


string

get string(): StringValidator<string>

Returns

StringValidator<string>

Defined in

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


uint16Array

get uint16Array(): TypedArrayValidator<Uint16Array>

Returns

TypedArrayValidator<Uint16Array>

Defined in

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


uint32Array

get uint32Array(): TypedArrayValidator<Uint32Array>

Returns

TypedArrayValidator<Uint32Array>

Defined in

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


uint8Array

get uint8Array(): TypedArrayValidator<Uint8Array>

Returns

TypedArrayValidator<Uint8Array>

Defined in

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


uint8ClampedArray

get uint8ClampedArray(): TypedArrayValidator<Uint8ClampedArray>

Returns

TypedArrayValidator<Uint8ClampedArray>

Defined in

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


undefined

get undefined(): BaseValidator<undefined>

Returns

BaseValidator<undefined>

Defined in

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


unknown

get unknown(): PassthroughValidator<unknown>

Returns

PassthroughValidator<unknown>

Defined in

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

Methods

array

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

Type parameters

Name
T

Parameters

NameType
validatorBaseValidator<T>

Returns

ArrayValidator<T[], T>

Defined in

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

array<T>(validator): ArrayValidator<T, T[number]>

Type parameters

NameType
Textends unknown[]

Parameters

NameType
validatorBaseValidator<T[number]>

Returns

ArrayValidator<T, T[number]>

Defined in

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


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:77


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:90


lazy

lazy<T>(validator): LazyValidator<T, Unwrap<T>>

Type parameters

NameType
Textends BaseValidator<unknown>

Parameters

NameType
validator(value: unknown) => T

Returns

LazyValidator<T, Unwrap<T>>

Defined in

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


literal

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

Type parameters

Name
T

Parameters

NameType
valueT

Returns

BaseValidator<T>

Defined in

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


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:164


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:81


object

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

Type parameters

NameType
Textends object

Parameters

NameType
shapeMappedObjectValidator<T>

Returns

ObjectValidator<T, UndefinedToOptional<T>>

Defined in

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


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:160


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:156


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:152


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:104


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:94