(keyValueArray: KeyValueArray<any>, key: unknown, value: any)
| 739 | * @param value The value to set. |
| 740 | */ |
| 741 | export function classKeyValueArraySet(keyValueArray: KeyValueArray<any>, key: unknown, value: any) { |
| 742 | // We use `classList.add` to eventually add the CSS classes to the DOM node. Any value passed into |
| 743 | // `add` is stringified and added to the `class` attribute, e.g. even null, undefined or numbers |
| 744 | // will be added. Stringify the key here so that our internal data structure matches the value in |
| 745 | // the DOM. The only exceptions are empty strings and strings that contain spaces for which |
| 746 | // the browser throws an error. We ignore such values, because the error is somewhat cryptic. |
| 747 | const stringKey = String(key); |
| 748 | if (stringKey !== '' && !stringKey.includes(' ')) { |
| 749 | keyValueArraySet(keyValueArray, stringKey, value); |
| 750 | } |
| 751 | } |
| 752 | |
| 753 | /** |
| 754 | * Update map based styling. |
nothing calls this directly
no test coverage detected
searching dependent graphs…