Skip to main content

Function: valueObject()

valueObject(klass, properties)

valueObject<C, P>(klass: Newable<C>, properties: NonEmptyObject<P>): ValueObjectModel

Builds a ValueObjectModel based on a Class.

Type Parameters

Type ParameterDescription
C extends objectThe class type.
P extends Properties<C>-

Parameters

ParameterTypeDescription
klassNewable<C>The class of the value object.
propertiesNonEmptyObject<P>The properties of the value object.

Returns

ValueObjectModel

The created value object model.

Defined in

packages/verse-core/src/model/builder.ts:156

valueObject(name, properties)

valueObject<O, P>(name: string, properties: NonEmptyObject<P>): ValueObjectModel

Builds a ValueObjectModel based on an Object.

Type Parameters

Type Parameter
O extends object
P extends Properties<O>

Parameters

ParameterTypeDescription
namestringThe name of the value object.
propertiesNonEmptyObject<P>The properties of the entity.

Returns

ValueObjectModel

The created value object model.

Defined in

packages/verse-core/src/model/builder.ts:168