new module:ct-element /formatter /Key Value Formatter()
Substitues a value with a mapped value if the a mapped value exists otherwise it returns the value itself.
The mAttributes
argument should have the map holding the mappings in it's
map
key.
- Implements:
Methods
format(vValue, mAttributes)
Substitues a value with a mapped value if the a mapped value exists otherwise it returns the value itself.
Parameters:
Name | Type | Description |
---|---|---|
vValue |
Variant | the key which is expected to have mapping to a value in mAttributes.map. |
mAttributes |
Map | the object which holds a map of key-value pairs in its "map" element. |
- Implements:
Returns:
the found value for the passed key or the the key if the value was not found.