Skip to main content
Version: 4.4

Class: EntityValidator#

core.EntityValidator

Hierarchy#

  • EntityValidator

Constructors#

constructor#

+ new EntityValidator(strict: boolean): EntityValidator

Parameters:#

NameType
strictboolean

Returns: EntityValidator

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

Methods#

fixBooleanType#

PrivatefixBooleanType(givenValue: number): number | boolean

Parameters:#

NameType
givenValuenumber

Returns: number | boolean

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


fixDateType#

PrivatefixDateType(givenValue: string): string | Date

Parameters:#

NameType
givenValuestring

Returns: string | Date

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


fixNumberType#

PrivatefixNumberType(givenValue: string): string | number

Parameters:#

NameType
givenValuestring

Returns: string | number

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


fixTypes#

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

Parameters:#

NameType
expectedTypestring
givenTypestring
givenValueany

Returns: any

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


getValue#

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

Parameters:#

NameType
oDictionary<any>
propEntityProperty<any>

Returns: any

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


setValue#

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

Parameters:#

NameType
oDictionary<any>
propEntityProperty<any>
vany

Returns: any

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


validate#

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityT
payloadany
metaEntityMetadata<any>

Returns: void

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


validateCollection#

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityT
propEntityProperty<any>

Returns: void

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


validateEmptyWhere#

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
whereFilterQuery<T>

Returns: void

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


validateParams#

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

Parameters:#

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

Returns: void

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


validatePrimaryKey#

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityEntityData<T>
metaEntityMetadata<any>

Returns: void

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


validateProperty#

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
propEntityProperty<any>
givenValueany
entityT

Returns: any

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

Last updated on by Martin Adámek