Version: 4.3

Class: EntityValidator

Hierarchy

  • EntityValidator

Constructors

constructor

+ new EntityValidator(strict: boolean): EntityValidator

Defined in packages/core/src/entity/EntityValidator.ts:6

Parameters:

NameType
strictboolean

Returns: EntityValidator

Properties

strict

Private strict: boolean

Defined in packages/core/src/entity/EntityValidator.ts:8

Methods

fixBooleanType

PrivatefixBooleanType(givenValue: number): boolean | number

Defined in packages/core/src/entity/EntityValidator.ts:147

Parameters:

NameType
givenValuenumber

Returns: boolean | number


fixDateType

PrivatefixDateType(givenValue: string): Date | string

Defined in packages/core/src/entity/EntityValidator.ts:130

Parameters:

NameType
givenValuestring

Returns: Date | string


fixNumberType

PrivatefixNumberType(givenValue: string): number | string

Defined in packages/core/src/entity/EntityValidator.ts:142

Parameters:

NameType
givenValuestring

Returns: number | string


fixTypes

PrivatefixTypes(expectedType: string, givenType: string, givenValue: any): any

Defined in packages/core/src/entity/EntityValidator.ts:114

Parameters:

NameType
expectedTypestring
givenTypestring
givenValueany

Returns: any


getValue

PrivategetValue(o: Dictionary, prop: EntityProperty): any

Defined in packages/core/src/entity/EntityValidator.ts:91

Parameters:

NameType
oDictionary
propEntityProperty

Returns: any


setValue

PrivatesetValue(o: Dictionary, prop: EntityProperty, v: any): any

Defined in packages/core/src/entity/EntityValidator.ts:99

Parameters:

NameType
oDictionary
propEntityProperty
vany

Returns: any


validate

validate<T>(entity: T, payload: any, meta: EntityMetadata): void

Defined in packages/core/src/entity/EntityValidator.ts:10

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityT
payloadany
metaEntityMetadata

Returns: void


validateCollection

PrivatevalidateCollection<T>(entity: T, prop: EntityProperty): void

Defined in packages/core/src/entity/EntityValidator.ts:108

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityT
propEntityProperty

Returns: void


validateEmptyWhere

validateEmptyWhere<T>(where: FilterQuery<T>): void

Defined in packages/core/src/entity/EntityValidator.ts:85

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
whereFilterQuery<T>

Returns: void


validateParams

validateParams(params: any, type?: string, field?: string): void

Defined in packages/core/src/entity/EntityValidator.ts:61

Parameters:

NameTypeDefault value
paramsany-
typestring"search condition"
field?string-

Returns: void


validatePrimaryKey

validatePrimaryKey<T>(entity: EntityData<T>, meta: EntityMetadata): void

Defined in packages/core/src/entity/EntityValidator.ts:77

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityEntityData<T>
metaEntityMetadata

Returns: void


validateProperty

validateProperty<T>(prop: EntityProperty, givenValue: any, entity: T): any

Defined in packages/core/src/entity/EntityValidator.ts:40

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
propEntityProperty
givenValueany
entityT

Returns: any

Last updated on by Martin Adámek