Type

flitter-orm/src/schema/Type~ Type

Base class for all schema types. Used to determine the validity of a value and to coerce that value to the proper type to fit the schema.


Constructor

new Type()

Methods

(static) cast(value) → {*}

Casts the specified value to this type. Note that, for recursive types (array, object), this will leave their sub-structures intact.

Parameters:
Name Type Description
value *
Returns:
Type
*

(static) validate(value) → {boolean}

Determines if the specified value can be cast to this type.

Parameters:
Name Type Description
value *
Returns:
Type
boolean