arrayOf(t: Type<T>): ArrayOfType<T>
Parameters
t (Type<T>)
Returns
ArrayOfType<T>

ArrayOfType

src/sync/Type.js
new ArrayOfType()

Extends Type

Instance Members
constructor(t, parse)
itemType
arrayType

Type: VType<Array<any>>

asyncArrayOf(t: AsyncType<T>): AsyncArrayOfType<T>
Parameters
t (AsyncType<T>)
Returns
AsyncArrayOfType<T>
new AsyncArrayOfType()

Extends AsyncType

Instance Members
constructor(t, parse)
innerType
new AsyncChainType()

Extends AsyncType

Instance Members
constructor(left, right)

AsyncComposeLeftType

src/async/AsyncType.js
new AsyncComposeLeftType()

Extends AsyncType

Instance Members
constructor(left, right)
right
asyncExpress
Static Members
middleware
middleware
requestMapping
requestMapping
asyncExpress
Static Members
middleware
middleware
requestMapping
requestMapping
asyncIntersection(a: AsyncType<A>, b: AsyncType<B>): AsyncIntersectionType<A, B>
Parameters
a (AsyncType<A>)
b (AsyncType<B>)
Returns
AsyncIntersectionType<A, B>

AsyncIntersectionType

src/async/AsyncType.js
new AsyncIntersectionType()

Extends AsyncType

Instance Members
constructor(a, b, parse)
asyncMapping(keys: AsyncType<K>, values: AsyncType<V>): AsyncMappingType<K, V>
Parameters
keys (AsyncType<K>)
values (AsyncType<V>)
Returns
AsyncMappingType<K, V>
new AsyncMappingType()

Extends AsyncType

Instance Members
constructor(keys, values, parse)
asyncObject(s: S): AsyncObjectType<S, $ObjMap<S, function (v: AsyncType<F>): F>>
Parameters
s (S)
Returns
AsyncObjectType<S, $ObjMap<S, function (v: AsyncType<F>): F>>
asyncObjectExact(s: S): AsyncObjectExactType<S, $Exact<$ObjMap<S, function (v: AsyncType<F>): F>>>
Parameters
s (S)
Returns
AsyncObjectExactType<S, $Exact<$ObjMap<S, function (v: AsyncType<F>): F>>>

AsyncObjectExactType

src/async/asyncObjectExact.js
new AsyncObjectExactType()

Extends AsyncType

Instance Members
constructor(schema, parse)
schema
new AsyncObjectType()

Extends AsyncType

Instance Members
constructor(schema, parse)
schema
asyncOptional(t: AsyncType<T>): AsyncOptionalType<T>
Parameters
t (AsyncType<T>)
Returns
AsyncOptionalType<T>

AsyncOptionalType

src/async/AsyncType.js
new AsyncOptionalType()

Extends AsyncType

Instance Members
constructor(t, validate)
innerType

AsyncRefinedType

src/async/AsyncType.js
new AsyncRefinedType()

Extends AsyncType

Instance Members
constructor(base, f)
revalidate()
asyncReturns(t: AsyncType<R>): function (f: function (): Promise<R>): function (): Promise<R>
Parameters
t (AsyncType<R>)
Returns
function (f: function (): Promise<R>): function (): Promise<R>
asyncTakes(AsyncTypes: ...Array<AsyncType<any>>): function (f: function (): Promise<R>): function (): Promise<R>
Parameters
AsyncTypes (...Array<AsyncType<any>>)
Returns
function (f: function (): Promise<R>): function (): Promise<R>
asyncTuple(s: S): AsyncTupleType<$TupleMap<S, function (v: AsyncType<T>): T>>
Parameters
s (S)
Returns
AsyncTupleType<$TupleMap<S, function (v: AsyncType<T>): T>>
new AsyncTupleType()

Extends AsyncType

Instance Members
constructor(schema, parse)
schema
new AsyncType()
Instance Members
and(t2)
chain(t2)
compose(f)
constructor(name, parse)
or(t2)
parse
refine(refinement)
to(transformation)
toJSON()
type
asyncUnion(a: AsyncType<A>, b: AsyncType<B>): AsyncUnionType<A, B>
Parameters
a (AsyncType<A>)
b (AsyncType<B>)
Returns
AsyncUnionType<A, B>
new AsyncUnionType()

Extends AsyncType

Instance Members
constructor(a, b, validate)
asyncVarrayOf(t: AsyncVType<T>): AsyncVArrayOfType<T>
Parameters
t (AsyncVType<T>)
Returns
AsyncVArrayOfType<T>
new AsyncVArrayOfType()

Extends AsyncVType

Instance Members
constructor(t, validate)
innerType
asyncVintersection(a: AsyncVType<A>, b: AsyncVType<B>): AsyncVIntersectionType<A, B>
Parameters
a (AsyncVType<A>)
b (AsyncVType<B>)
Returns
AsyncVIntersectionType<A, B>

AsyncVIntersectionType

src/async/AsyncVType.js
new AsyncVIntersectionType()

Extends AsyncVType

Instance Members
constructor(a, b, validate)
asyncVmapping(keys: AsyncVType<K>, values: AsyncVType<V>): AsyncVMappingType<K, V>
Parameters
keys (AsyncVType<K>)
values (AsyncVType<V>)
Returns
AsyncVMappingType<K, V>
new AsyncVMappingType()

Extends AsyncVType

Instance Members
constructor(keys, values, validate)
asyncVobject(s: S): AsyncVObjectType<S, $ObjMap<S, function (v: AsyncVType<F>): F>>
Parameters
s (S)
Returns
AsyncVObjectType<S, $ObjMap<S, function (v: AsyncVType<F>): F>>
asyncVobjectExact(s: S): AsyncVObjectExactType<S, $Exact<$ObjMap<S, function (v: AsyncVType<F>): F>>>
Parameters
s (S)
Returns
AsyncVObjectExactType<S, $Exact<$ObjMap<S, function (v: AsyncVType<F>): F>>>

AsyncVObjectExactType

src/async/asyncVobjectExact.js
new AsyncVObjectExactType()

Extends AsyncVType

Instance Members
constructor(schema, validate)
new AsyncVObjectType()

Extends AsyncVType

Instance Members
constructor(schema, validate)
schema
asyncVoptional(t: AsyncVType<T>): AsyncVOptionalType<T>
Parameters
t (AsyncVType<T>)
Returns
AsyncVOptionalType<T>

AsyncVOptionalType

src/async/AsyncVType.js
new AsyncVOptionalType()

Extends AsyncVType

Instance Members
constructor(t, validate)
innerType

AsyncVRefinedType

src/async/AsyncVType.js
new AsyncVRefinedType()

Extends AsyncVType

Instance Members
constructor(base, f)
revalidate()
asyncVreturns(t: AsyncVType<R>): function (f: function (): Promise<R>): function (): Promise<R>
Parameters
t (AsyncVType<R>)
Returns
function (f: function (): Promise<R>): function (): Promise<R>
asyncVtakes(AsyncTypes: ...Array<AsyncVType<any>>): function (f: function (): Promise<R>): function (): Promise<R>
Parameters
AsyncTypes (...Array<AsyncVType<any>>)
Returns
function (f: function (): Promise<R>): function (): Promise<R>
asyncVtuple(s: S): AsyncVTupleType<$TupleMap<S, function (v: AsyncType<T>): T>>
Parameters
s (S)
Returns
AsyncVTupleType<$TupleMap<S, function (v: AsyncType<T>): T>>
new AsyncVTupleType()

Extends AsyncVType

Instance Members
constructor(schema, parse)
schema
new AsyncVType()

Extends AsyncType

Instance Members
constructor(name, validate)
validate
Vand(t2)
Vor(t2)
Vrefine(refinement)
asyncVunion(a: AsyncVType<A>, b: AsyncVType<B>): AsyncVUnionType<A, B>
Parameters
a (AsyncVType<A>)
b (AsyncVType<B>)
Returns
AsyncVUnionType<A, B>
new AsyncVUnionType()

Extends AsyncVType

Instance Members
constructor(a, b, validate)
boolean

Type: VType<boolean>

new ChainType()

Extends Type

Instance Members
constructor(left, right)
left
right
classOf(c: Class<T>): ClassOfType<Class<T>>
Parameters
c (Class<T>)
Returns
ClassOfType<Class<T>>
new ClassOfType()

Extends VType

Instance Members
class
constructor(c, validate)
composeLeft(a: Type<T1>, b: function (v: T1): T2): ComposeLeftType<T1, T2>
Parameters
a (Type<T1>)
b (function (v: T1): T2)
Returns
ComposeLeftType<T1, T2>

ComposeLeftType

src/sync/Type.js
new ComposeLeftType()

Extends Type

Instance Members
constructor(left, right)
left
right
composeRight(a: function (v: T1): T2, b: Type<T1>): ComposeRightType<T1, T2>
Parameters
a (function (v: T1): T2)
b (Type<T1>)
Returns
ComposeRightType<T1, T2>

ComposeRightType

src/sync/Type.js
new ComposeRightType()

Extends Type

Instance Members
constructor(left, right)
left
right
empty

Type: VType<(void | null)>

Errors

Type: {}

express
Static Members
endpoint
endpoint
middleware
middleware
requestMapping
requestMapping
express
Static Members
endpoint
endpoint
middleware
middleware
requestMapping
requestMapping
falsy

Type: Type<false>

functionType

src/sync/base.js
functionType

Type: VType<Function>

instanceOf(c: Class<T>): InstanceOfType<T>
Parameters
c (Class<T>)
Returns
InstanceOfType<T>

InstanceOfType

src/sync/VType.js
new InstanceOfType()

Extends VType

Instance Members
class
constructor(c, validate)
intersection(a: Type<A>, b: Type<B>): IntersectionType<A, B>
Parameters
a (Type<A>)
b (Type<B>)
Returns
IntersectionType<A, B>

IntersectionType

src/sync/Type.js
new IntersectionType()

Extends Type

Instance Members
constructor(a, b, parse)
typeA
typeB
isAny

Type: VType<any>

isMixed

Type: VType<any>

isNull

Type: VType<null>

isUndefined

src/sync/base.js
isUndefined

Type: VType<void>

literal(value: T): LiteralType<T>
Parameters
value (T)
Returns
LiteralType<T>
new LiteralType()

Extends VType

Instance Members
constructor(t, validate)
value
mapping(keys: Type<K>, values: Type<V>): MappingType<K, V>
Parameters
keys (Type<K>)
values (Type<V>)
Returns
MappingType<K, V>

MappingType

src/sync/Type.js
new MappingType()

Extends Type

Instance Members
constructor(keys, values, parse)
keys
values
match(patterns: ...any)
Parameters
patterns (...any)
noProperty

Type: VType<void>

number

Type: VType<number>

object(s: S): ObjectType<S, $ObjMap<S, function (v: Type<F>): F>>
Parameters
s (S)
Returns
ObjectType<S, $ObjMap<S, function (v: Type<F>): F>>
objectExact(s: S): ObjectExactType<S, $Exact<$ObjMap<S, function (v: Type<F>): F>>>
Parameters
s (S)
Returns
ObjectExactType<S, $Exact<$ObjMap<S, function (v: Type<F>): F>>>

ObjectExactType

src/sync/Type.js
new ObjectExactType()

Extends Type

Instance Members
constructor(schema, parse)
schema
new ObjectType()

Extends Type

Instance Members
constructor(schema, parse)
schema
objectType

Type: VType<Object>

optional(t: Type<T>): OptionalType<T>
Parameters
t (Type<T>)
Returns
OptionalType<T>

OptionalType

src/sync/Type.js
new OptionalType()

Extends Type

Instance Members
constructor(t, validate)
innerType

RefinedType

src/sync/Type.js
new RefinedType()

Extends Type

Instance Members
base
constructor(base, f)
revalidate()
returns(t: Type<R>): function (f: function (): R): function (): R
Parameters
t (Type<R>)
Returns
function (f: function (): R): function (): R
string

Type: StringType

new StringType()

Extends VType

Instance Members
constructor(parse)
isEmail()
isValidDate()
maxLength(length)
minLength(length)
regexp(regularExpression)
toDate()
syncFunctionToAsync(f: function (value: any): (T | Promise<T>)): function (value: any): Promise<T>
Parameters
f (function (value: any): (T | Promise<T>))
Returns
function (value: any): Promise<T>
takes(types: ...Array<Type<any>>): function (f: function (): R): function (): R
Parameters
types (...Array<Type<any>>)
Returns
function (f: function (): R): function (): R
truthy

Type: Type<true>

tuple(s: S): TupleType<$TupleMap<S, function (v: Type<T>): T>>
Parameters
s (S)
Returns
TupleType<$TupleMap<S, function (v: Type<T>): T>>
new TupleType()

Extends Type

Instance Members
constructor(schema, parse)
schema
new Type()
Instance Members
and(t2)
async()
chain(t2)
compose(f)
constructor(name, parse)
default(value)
force(value)
name
optional()
or(t2)
parse
parseResult(v)
refine(refinement)
to(transformation)
toJSON()
type
union(a: Type<A>, b: Type<B>): UnionType<A, B>
Parameters
a (Type<A>)
b (Type<B>)
Returns
UnionType<A, B>
unionFromObjectKeys(o: O): Type<$Keys<O>>
Parameters
o (O)
Returns
Type<$Keys<O>>
new UnionType()

Extends Type

Instance Members
constructor(a, b, validate)
typeA
typeB
new ValidationError()

Extends Error

Instance Members

ValidationErrorJSONPayload

src/sync/ValidationError.js
ValidationErrorJSONPayload

Type: {expected: {name: string}, description: string?, got: any, errors: {}?}

ValidationErrorPayload

src/sync/ValidationError.js
ValidationErrorPayload

Type: {expected: (Type<any> | AsyncType<any>), got: any, errors: Errors?, description: string?}

new VarrayOf(t: VType<T>): VArrayOfType<T>
Parameters
t (VType<T>)
Returns
VArrayOfType<T>

VArrayOfType

src/sync/VType.js
new VArrayOfType()

Extends VType

Instance Members
constructor(t, validate)
itemType
new Vintersection(a: VType<A>, b: VType<B>): VIntersectionType<A, B>
Parameters
a (VType<A>)
b (VType<B>)
Returns
VIntersectionType<A, B>

VIntersectionType

src/sync/VType.js
new VIntersectionType()

Extends VType

Instance Members
constructor(a, b, validate)
typeA
typeB
new Vmapping(keys: VType<K>, values: VType<V>): VMappingType<K, V>
Parameters
keys (VType<K>)
values (VType<V>)
Returns
VMappingType<K, V>

VMappingType

src/sync/VType.js
new VMappingType()

Extends VType

Instance Members
constructor(keys, values, validate)
keys
values
new Vobject(s: S): VObjectType<S, $ObjMap<S, function (v: VType<F>): F>>
Parameters
s (S)
Returns
VObjectType<S, $ObjMap<S, function (v: VType<F>): F>>
new VobjectExact(s: S): VObjectExactType<S, $Exact<$ObjMap<S, function (v: VType<F>): F>>>
Parameters
s (S)
Returns
VObjectExactType<S, $Exact<$ObjMap<S, function (v: VType<F>): F>>>

VObjectExactType

src/sync/VType.js
new VObjectExactType()

Extends VType

Instance Members
constructor(schema, validate)
schema
new VObjectType()

Extends VType

Instance Members
constructor(schema, validate)
schema
new Voptional(t: VType<T>): VOptionalType<T>
Parameters
t (VType<T>)
Returns
VOptionalType<T>

VOptionalType

src/sync/VType.js
new VOptionalType()

Extends VType

Instance Members
constructor(t, validate)
innerType

VRefinedType

src/sync/VType.js
new VRefinedType()

Extends VType

Instance Members
base
constructor(base, f)
revalidate()
new Vreturns(t: VType<R>): function (f: function (): R): function (): R
Parameters
t (VType<R>)
Returns
function (f: function (): R): function (): R
new Vtakes(types: ...Array<VType<any>>): function (f: function (): R): function (): R
Parameters
types (...Array<VType<any>>)
Returns
function (f: function (): R): function (): R
new Vtuple(s: S): VTupleType<$TupleMap<S, function (v: Type<T>): T>>
Parameters
s (S)
Returns
VTupleType<$TupleMap<S, function (v: Type<T>): T>>
new VTupleType()

Extends VType

Instance Members
constructor(schema, validate)
schema
new VType()

Extends Type

Instance Members
constructor(name, validate)
isValid(v)
validate
validateResult(v)
Vand(t2)
Vasync()
Voptional()
Vor(t2)
Vrefine(refinement)
new Vunion(a: VType<A>, b: VType<B>): VUnionType<A, B>
Parameters
a (VType<A>)
b (VType<B>)
Returns
VUnionType<A, B>
new VUnionType()

Extends VType

Instance Members
constructor(a, b, validate)
typeA
typeB