Skip to main content

Class: ObjectUtils

Defined in: core/src/ObjectUtils.ts:14

Utility class for working with objects.

Constructors

Constructor

new ObjectUtils(): ObjectUtils

Returns

ObjectUtils

Methods

deleteScopedProps()

static deleteScopedProps(obj, user?, clazz?, recurse?): void

Defined in: core/src/ObjectUtils.ts:23

Deletes all properties from the given object(s) that the specified user does not have scope to read.

Parameters

obj

any

The object(s) to process.

user?

JWTUser

The user whose scope permissions will be tested.

clazz?

any

The class type that contains the

recurse?

boolean

Set to true to validate all child objects.

Returns

void

Requires Scope

metadata.


validate()

static validate(obj, clazz?, recurse?): void

Defined in: core/src/ObjectUtils.ts:56

Performs validation of the given object or array. Validation is performed by scanning the object class for properties decorated with @Validator and executing the provided validation function.

Parameters

obj

any

The object or array of objects to validate.

clazz?

any

The class type that contains the validation metadata.

recurse?

boolean

Set to true to validate all child objects.

Returns

void