Skip to main content

Class: abstract CoreType

Defined in: schema/types/core-type.ts:22

Param​

of field in schema

Param​

name of type

Param​

Param​

flag to define if the field is mandatory

Param​

that will be applied to the field, allowed function, object or string with the name of the custom validator

Param​

that will define the initial value of the field, this option allows a value or a function

Param​

that will define this field as immutable. Ottoman prevents you from changing immutable fields if the schema as configure like strict

Extends​

Extended by​

Constructors​

Constructor​

protected new CoreType(name, typeName, options?): CoreType

Defined in: schema/types/core-type.ts:23

Parameters​

name​

string

typeName​

string

options?​

CoreTypeOptions

Returns​

CoreType

Overrides​

IOttomanType.constructor

Properties​

name​

name: string

Defined in: schema/interfaces/schema.types.ts:51

Inherited from​

IOttomanType.name


options?​

optional options: CoreTypeOptions

Defined in: schema/types/core-type.ts:23


typeName​

typeName: string

Defined in: schema/interfaces/schema.types.ts:51

Inherited from​

IOttomanType.typeName


sName​

static sName: any

Defined in: schema/types/core-type.ts:29

Accessors​

default​

Get Signature​

get default(): unknown

Defined in: schema/types/core-type.ts:39

Returns​

unknown


required​

Get Signature​

get required(): boolean | RequiredOption | RequiredFunction

Defined in: schema/types/core-type.ts:31

Returns​

boolean | RequiredOption | RequiredFunction


validator​

Get Signature​

get validator(): undefined | string | ValidatorFunction | ValidatorOption

Defined in: schema/types/core-type.ts:35

Returns​

undefined | string | ValidatorFunction | ValidatorOption

Methods​

buildDefault()​

buildDefault(): unknown

Defined in: schema/types/core-type.ts:43

Returns​

unknown


cast()​

abstract cast(value, strategy?): unknown

Defined in: schema/interfaces/schema.types.ts:52

Parameters​

value​

unknown

strategy?​

CAST_STRATEGY

Returns​

unknown

Inherited from​

IOttomanType.cast


checkRequired()​

checkRequired(): string | void

Defined in: schema/types/core-type.ts:62

Returns​

string | void


checkValidator()​

checkValidator(value): void

Defined in: schema/types/core-type.ts:71

Parameters​

value​

unknown

Returns​

void


isEmpty()​

isEmpty(value): boolean

Defined in: schema/types/core-type.ts:75

Parameters​

value​

unknown

Returns​

boolean


isStrictStrategy()​

isStrictStrategy(strategy): boolean

Defined in: schema/types/core-type.ts:79

Parameters​

strategy​

VALIDATION_STRATEGY

Returns​

boolean


validate()​

validate(value, strict): unknown

Defined in: schema/types/core-type.ts:52

Parameters​

value​

unknown

strict​

boolean = true

Returns​

unknown

Overrides​

IOttomanType.validate