Class: ObjectSerializer<Data>
object.ObjectSerializer
Type parameters
Name |
---|
Data |
Hierarchy
ObjectSerializer
Implements
SerializerI
<Data
>
Constructors
constructor
• new ObjectSerializer<Data
>(config?
)
Type parameters
Name |
---|
Data |
Parameters
Name | Type |
---|---|
config? | ObjectSerializerConfig |
Defined in
src/object/objectSerializer.ts:19
Methods
configure
▸ configure(config?
, override?
): void
Parameters
Name | Type | Default value |
---|---|---|
config? | ObjectSerializerConfig | undefined |
override | boolean | true |
Returns
void
Defined in
src/object/objectSerializer.ts:23
hydrateAttributeInResource
▸ Protected
hydrateAttributeInResource(resource
, serializedKey
, serializedValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
resource | Data |
serializedKey | string |
serializedValue | unknown |
Returns
Promise
<void
>
Defined in
src/object/objectSerializer.ts:82
hydratePropInResource
▸ Protected
hydratePropInResource(_resource
, _serializedKey
, _serializedValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
_resource | Data |
_serializedKey | string |
_serializedValue | unknown |
Returns
Promise
<void
>
Defined in
src/object/objectSerializer.ts:72
hydrateRelationInResource
▸ Protected
hydrateRelationInResource(resource
, serializedKey
, serializedValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
resource | Data |
serializedKey | string |
serializedValue | unknown |
Returns
Promise
<void
>
Defined in
src/object/objectSerializer.ts:90
makeResource
▸ Protected
Abstract
makeResource(instance
, context
): Promise
<Data
>
Parameters
Name | Type |
---|---|
instance | ModelInstance |
context | Object |
Returns
Promise
<Data
>
Defined in
src/object/objectSerializer.ts:63
serialize
▸ serialize(instance
, context
): Promise
<Data
>
Parameters
Name | Type |
---|---|
instance | ModelInstance |
context | Object |
Returns
Promise
<Data
>
Implementation of
SerializerI.serialize
Defined in
src/object/objectSerializer.ts:27
serializeAttributeKey
▸ Protected
serializeAttributeKey(instance
, def
, _context
): Promise
<string
>
Parameters
Name | Type |
---|---|
instance | ModelInstance |
def | ModelAttribute |
_context | Object |
Returns
Promise
<string
>
Defined in
src/object/objectSerializer.ts:98
serializeAttributeValue
▸ Protected
serializeAttributeValue(_instance
, def
, rawValue
, _context
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
_instance | ModelInstance |
def | ModelAttribute |
rawValue | unknown |
_context | Object |
Returns
Promise
<unknown
>
Defined in
src/object/objectSerializer.ts:143
serializeRelatedInstance
▸ Protected
Abstract
serializeRelatedInstance(instance
, def
, related
, context
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
instance | ModelInstance |
def | ModelRelation |
related | ModelInstance |
context | Object |
Returns
Promise
<unknown
>
Defined in
src/object/objectSerializer.ts:65
serializeRelationKey
▸ Protected
serializeRelationKey(instance
, def
, _context
): Promise
<string
>
Parameters
Name | Type |
---|---|
instance | ModelInstance |
def | ModelRelation |
_context | Object |
Returns
Promise
<string
>
Defined in
src/object/objectSerializer.ts:106
serializeRelationValue
▸ Protected
serializeRelationValue(instance
, def
, rawValue
, context
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
instance | ModelInstance |
def | ModelRelation |
rawValue | unknown |
context | Object |
Returns
Promise
<unknown
>
Defined in
src/object/objectSerializer.ts:154
shouldSerializeAttribute
▸ Protected
shouldSerializeAttribute(instance
, def
, rawValue
, context
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
instance | ModelInstance |
def | ModelAttribute |
rawValue | unknown |
context | Object |
Returns
Promise
<boolean
>
Defined in
src/object/objectSerializer.ts:114
shouldSerializeProp
▸ Protected
shouldSerializeProp(instance
, def
, rawValue
, _context
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
instance | ModelInstance |
def | ModelRelation | ModelAttribute |
rawValue | unknown |
_context | Object |
Returns
Promise
<boolean
>
Defined in
src/object/objectSerializer.ts:132
shouldSerializeRelation
▸ Protected
shouldSerializeRelation(instance
, def
, rawValue
, context
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
instance | ModelInstance |
def | ModelRelation |
rawValue | unknown |
context | Object |
Returns
Promise
<boolean
>
Defined in
src/object/objectSerializer.ts:123