new Content(messages)
A class to provide messages with substitution values
Parameters:
| Name | Type | Description |
|---|---|---|
messages |
Object.<string, string> | Array.<Object.<string, string>> | The messages with optional tokens mapped by message id |
- Source:
Extends
Methods
message(msgId, valuesopt) → {string}
Returns a content message with substituted valeus
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
msgId |
string | The id for the message | |
values |
Object.<string, string> |
<optional> |
The substitution values |
- Source:
Returns:
The message with substituted values if provided
- Type
- string
replace(str, values) → {string}
Replace tokens in a string with values from a provided object
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string | String with tokens to be replaced |
values |
Object.<string, string> | Values token for replacement |
- Inherited From:
- Source:
Returns:
String with replacement value substitution
- Type
- string