Exposes objects as another value when serialized.
expose
uses the expose
property of object resources
internally.
Parameters
Name | Type | Attributes | Description |
---|---|---|---|
obj |
object | The object to expose. |
|
val |
any |
<optional> |
The value that should be used instead of obj when serialized. If not specified and |
Returns
The exposed object.
- Type
- object
Classes
Methods
(inner) getValue(object) → {any}
Returns the value an object is exposed with. undefined
if the given object is not exposed.
Parameters
Name | Type | Description |
---|---|---|
object |
any | The object to look up. This can be any value. The method will always return |
Returns
The exposed value of the given object.
- Type
- any
(inner) isExposed(object) → {boolean}
Checks whether a given object is exposed.
Parameters
Name | Type | Description |
---|---|---|
object |
any | The object to check. This can be any value. The method will always return |
Returns
true
if the object is exposed. false
if not.
- Type
- boolean
(inner) properties(obj, properties) → {object}
Exposes the given object so that only the given iterable collection of properties will be serialized.
Parameters
Name | Type | Description |
---|---|---|
obj |
object | The object that should be exposed. |
properties |
Iterable.<string> | An iterable collection of property strings that should be exposed. |
Returns
The exposed object.
- Type
- object