# Class: CoreType

param of field in schema

param name of type


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

# Hierarchy

# Constructors

# Protected constructor

+ new CoreType(name: string, typeName: string, options?: CoreTypeOptions): CoreType

Overrides IOttomanType.constructor


Name Type
name string
typeName string
options? CoreTypeOptions

Returns: CoreType

# Properties

# name

name: string

Inherited from IOttomanType.name

# Optional options

options? : CoreTypeOptions

# typeName

typeName: string

Inherited from IOttomanType.typeName

# Static sName

sName: any

# Accessors

# default

get default(): unknown

Returns: unknown

# required

get required(): boolean | RequiredOption | RequiredFunction

Returns: boolean | RequiredOption | RequiredFunction

# validator

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

Returns: ValidatorOption | ValidatorFunction | string | undefined

# Methods

# buildDefault

buildDefault(): unknown

Returns: unknown

# Abstract cast

cast(value: unknown, strategy?: CAST_STRATEGY): unknown

Inherited from IOttomanType.cast


Name Type
value unknown

Returns: unknown

# checkRequired

checkRequired(): string | void

Returns: string | void

# checkValidator

checkValidator(value: unknown): void


Name Type
value unknown

Returns: void

# isEmpty

isEmpty(value: unknown): boolean


Name Type
value unknown

Returns: boolean

# isStrictStrategy

isStrictStrategy(strategy: VALIDATION_STRATEGY): boolean


Name Type

Returns: boolean

# validate

validate(value: unknown, strict: boolean): unknown

Overrides IOttomanType.validate


Name Type Default
value unknown -
strict boolean true

Returns: unknown