type-definitions
Version:
Define and validate types in js
37 lines (32 loc) • 575 B
JavaScript
import {
BaseType,
UnionType,
AnyType,
coerce,
unionOf,
optional,
defaultValue
} from './base';
import ArrayType from './Array';
import BooleanType from './Boolean';
import NumberType from './Number';
import ObjectType, { strict } from './Object';
import StringType from './String';
const types = {
Base: BaseType,
Union: UnionType,
Any: AnyType,
Object: ObjectType,
Array: ArrayType,
String: StringType,
Number: NumberType,
Boolean: BooleanType
};
export {
coerce as defineType,
unionOf,
optional,
strict,
defaultValue,
types
}