a JavaScript object with strings as property names and strings or array of strings as values.
Iterates over the map yielding the values.
Adds an array to a key.
If no array is associated with the key, assign the array.
If the key is already associated with a string value, the value will be an array containing both the previous string value and the elements of the new array.
If the key is already associated with an array of strings, the value will be an array containing both the elements of the previous and new arrays.
Use {@link StringMap#set}, {@link StringMap#setString}, or {@link StringMap#setArray} to replace the value.
the key to associate the new value with.
the array to associate the key with.
Adds a string value to a key.
If no string is associated with the key, assign the string.
If the key is already associated with a string, the value will be an array containing both the previous string and the new string.
If an array of strings is associated with the key, append the string.
the key to associate the new value with.
the value to associate the key with.
Iterates over the map, yielding a tuple of key and values.
Returns the value associated with the key. If the key is not found, returns null.
the key to look up.
The value associated with the key.
A function for retrieving an array of strings.
the key for the value.
string
if the value exists.
null
if the key isn't an array or doesn't exist.
Convenience function for getting a string and converting to a number if possible. It uses the unary plus operator to convert the value.
the key for the value.
number
if the value can be converted to a number.
null
if the value can't be converted to a number
or if the key doesn't exist.
A function for retrieving a string value.
the key for the value.
A string
if the value exists. null
if the key doesn't exist.
Checks if the key exists in the map.
the key to check.
true
if the key exists. false
otherwise.
Removes the key, and it's value from the map.
the key to remove.
Sets the value of a key in the map.
NOTE: This will replace the previous value. Use {@link StringMap#addStringToKey}` or {@link StringMap#addArrayToKey} if you want to combine the previous and new values
the key to associate the new value with.
the value to associate the key with.
Sets an array as the value of a key in the map.
NOTE: This will replace the previous value. Use {@link StringMap#addStringToKey}` or {@link StringMap#addArrayToKey} if you want to combine the previous and new values
the key to associate the new value with.
the array to associate the key with.
Sets the value of a key in the map.
NOTE: This will replace the previous value. Use {@link StringMap#addStringToKey}` or {@link StringMap#addArrayToKey} if you want to combine the previous and new values
the key to associate the new value with.
the string to associate the key with.
Generated using TypeDoc
A map for key-to-string or key-to-array-of-strings. Exposes convenient methods for storing and retrieving values from the map.