Class: Shapes
Constructors
new Shapes()
new Shapes():
Shapes
Returns
Methods
any()
any(
options
?:ValidatorOptions
):PassthroughValidator
<any
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
PassthroughValidator
<any
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:66
array()
array(validator, options)
array<
T
>(validator
:BaseValidator
<T
>,options
?:ValidatorOptions
):ArrayValidator
<T
[],T
>
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
validator | BaseValidator <T > |
options ? | ValidatorOptions |
Returns
ArrayValidator
<T
[], T
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:105
array(validator, options)
array<
T
>(validator
:BaseValidator
<T
[number
]>,options
?:ValidatorOptions
):ArrayValidator
<T
,T
[number
]>
Type Parameters
Type Parameter |
---|
T extends unknown [] |
Parameters
Parameter | Type |
---|---|
validator | BaseValidator <T [number ]> |
options ? | ValidatorOptions |
Returns
ArrayValidator
<T
, T
[number
]>
Defined in
projects/shapeshift/src/lib/Shapes.ts:106
bigInt64Array()
bigInt64Array(
options
?:ValidatorOptions
):TypedArrayValidator
<BigInt64Array
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<BigInt64Array
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:151
bigUint64Array()
bigUint64Array(
options
?:ValidatorOptions
):TypedArrayValidator
<BigUint64Array
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<BigUint64Array
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:155
bigint()
bigint(
options
?:ValidatorOptions
):BigIntValidator
<bigint
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
BigIntValidator
<bigint
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:38
boolean()
boolean(
options
?:ValidatorOptions
):BooleanValidator
<boolean
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
BooleanValidator
<boolean
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:42
date()
date(
options
?:ValidatorOptions
):DateValidator
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
Defined in
projects/shapeshift/src/lib/Shapes.ts:46
enum()
enum<
T
>(values
: readonlyT
[],options
?:ValidatorOptions
):UnionValidator
<T
>
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
values | readonly T [] |
options ? | ValidatorOptions |
Returns
Defined in
projects/shapeshift/src/lib/Shapes.ts:78
float32Array()
float32Array(
options
?:ValidatorOptions
):TypedArrayValidator
<Float32Array
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<Float32Array
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:143
float64Array()
float64Array(
options
?:ValidatorOptions
):TypedArrayValidator
<Float64Array
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<Float64Array
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:147
instance()
instance<
T
>(expected
:Constructor
<T
>,options
?:ValidatorOptions
):InstanceValidator
<T
>
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
expected | Constructor <T > |
options ? | ValidatorOptions |
Returns
Defined in
projects/shapeshift/src/lib/Shapes.ts:97
int16Array()
int16Array(
options
?:ValidatorOptions
):TypedArrayValidator
<Int16Array
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<Int16Array
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:127
int32Array()
int32Array(
options
?:ValidatorOptions
):TypedArrayValidator
<Int32Array
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<Int32Array
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:135
int8Array()
int8Array(
options
?:ValidatorOptions
):TypedArrayValidator
<Int8Array
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<Int8Array
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:115
lazy()
lazy<
T
>(validator
: (value
:unknown
) =>T
,options
?:ValidatorOptions
):LazyValidator
<T
,Unwrap
<T
>>
Type Parameters
Type Parameter |
---|
T extends BaseValidator <unknown > |
Parameters
Parameter | Type |
---|---|
validator | (value : unknown ) => T |
options ? | ValidatorOptions |
Returns
LazyValidator
<T
, Unwrap
<T
>>
Defined in
projects/shapeshift/src/lib/Shapes.ts:175
literal()
literal<
T
>(value
:T
,options
?:object
):BaseValidator
<T
>
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
value | T |
options ? | object |
options.dateOptions ? | ValidatorOptions |
options.equalsOptions ? | ValidatorOptions |
Returns
Defined in
projects/shapeshift/src/lib/Shapes.ts:89
map()
map<
T
,U
>(keyValidator
:BaseValidator
<T
>,valueValidator
:BaseValidator
<U
>,options
?:ValidatorOptions
):MapValidator
<T
,U
>
Type Parameters
Type Parameter |
---|
T |
U |
Parameters
Parameter | Type |
---|---|
keyValidator | BaseValidator <T > |
valueValidator | BaseValidator <U > |
options ? | ValidatorOptions |
Returns
MapValidator
<T
, U
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:171
nativeEnum()
nativeEnum<
T
>(enumShape
:T
,options
?:ValidatorOptions
):NativeEnumValidator
<T
>
Type Parameters
Type Parameter |
---|
T extends NativeEnumLike |
Parameters
Parameter | Type |
---|---|
enumShape | T |
options ? | ValidatorOptions |
Returns
Defined in
projects/shapeshift/src/lib/Shapes.ts:85
never()
never(
options
?:ValidatorOptions
):NeverValidator
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
Defined in
projects/shapeshift/src/lib/Shapes.ts:74
null()
null(
options
?:ValidatorOptions
):BaseValidator
<null
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
BaseValidator
<null
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:58
nullish()
nullish(
options
?:ValidatorOptions
):NullishValidator
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
Defined in
projects/shapeshift/src/lib/Shapes.ts:62
number()
number(
options
?:ValidatorOptions
):NumberValidator
<number
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
NumberValidator
<number
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:34
object()
object<
T
>(shape
:MappedObjectValidator
<T
>,options
?:ValidatorOptions
):ObjectValidator
<T
,UndefinedToOptional
<T
>>
Type Parameters
Type Parameter |
---|
T extends object |
Parameters
Parameter | Type |
---|---|
shape | MappedObjectValidator <T > |
options ? | ValidatorOptions |
Returns
ObjectValidator
<T
, UndefinedToOptional
<T
>>
Defined in
projects/shapeshift/src/lib/Shapes.ts:50
record()
record<
T
>(validator
:BaseValidator
<T
>,options
?:ValidatorOptions
):RecordValidator
<T
>
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
validator | BaseValidator <T > |
options ? | ValidatorOptions |
Returns
Defined in
projects/shapeshift/src/lib/Shapes.ts:167
set()
set<
T
>(validator
:BaseValidator
<T
>,options
?:ValidatorOptions
):SetValidator
<T
>
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
validator | BaseValidator <T > |
options ? | ValidatorOptions |
Returns
SetValidator
<T
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:163
string()
string(
options
?:ValidatorOptions
):StringValidator
<string
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
StringValidator
<string
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:30
tuple()
tuple<
T
>(validators
: [...T[]
],options
?:ValidatorOptions
):TupleValidator
<UnwrapTuple
<T
>>
Type Parameters
Type Parameter |
---|
T extends BaseValidator <any >[] |
Parameters
Parameter | Type |
---|---|
validators | [...T[] ] |
options ? | ValidatorOptions |
Returns
TupleValidator
<UnwrapTuple
<T
>>
Defined in
projects/shapeshift/src/lib/Shapes.ts:159
typedArray()
typedArray<
T
>(type
:"Int8Array"
|"Uint8Array"
|"Uint8ClampedArray"
|"Int16Array"
|"Uint16Array"
|"Int32Array"
|"Uint32Array"
|"Float32Array"
|"Float64Array"
|"BigInt64Array"
|"BigUint64Array"
|"TypedArray"
,options
?:ValidatorOptions
):TypedArrayValidator
<T
>
Type Parameters
Type Parameter |
---|
T extends TypedArray |
Parameters
Parameter | Type | Default value |
---|---|---|
type | "Int8Array" | "Uint8Array" | "Uint8ClampedArray" | "Int16Array" | "Uint16Array" | "Int32Array" | "Uint32Array" | "Float32Array" | "Float64Array" | "BigInt64Array" | "BigUint64Array" | "TypedArray" | 'TypedArray' |
options ? | ValidatorOptions | undefined |
Returns
Defined in
projects/shapeshift/src/lib/Shapes.ts:111
uint16Array()
uint16Array(
options
?:ValidatorOptions
):TypedArrayValidator
<Uint16Array
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<Uint16Array
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:131
uint32Array()
uint32Array(
options
?:ValidatorOptions
):TypedArrayValidator
<Uint32Array
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<Uint32Array
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:139
uint8Array()
uint8Array(
options
?:ValidatorOptions
):TypedArrayValidator
<Uint8Array
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<Uint8Array
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:119
uint8ClampedArray()
uint8ClampedArray(
options
?:ValidatorOptions
):TypedArrayValidator
<Uint8ClampedArray
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
TypedArrayValidator
<Uint8ClampedArray
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:123
undefined()
undefined(
options
?:ValidatorOptions
):BaseValidator
<undefined
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
BaseValidator
<undefined
>
Defined in
projects/shapeshift/src/lib/Shapes.ts:54
union()
union<
T
>(validators
:T
,options
?:ValidatorOptions
):UnionValidator
<Unwrap
<T
[number
]>>
Type Parameters
Type Parameter |
---|
T extends BaseValidator <any >[] |
Parameters
Parameter | Type |
---|---|
validators | T |
options ? | ValidatorOptions |
Returns
UnionValidator
<Unwrap
<T
[number
]>>
Defined in
projects/shapeshift/src/lib/Shapes.ts:101
unknown()
unknown(
options
?:ValidatorOptions
):PassthroughValidator
<unknown
>
Parameters
Parameter | Type |
---|---|
options ? | ValidatorOptions |
Returns
PassthroughValidator
<unknown
>