@iobroker/adapter-react-v5 7.6.6 → 7.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -195,7 +195,7 @@ export declare class Utils {
195
195
  * @param hex Color in the format '#rrggbb' or '#rgb' (or without a hash)
196
196
  * @param bw Set to black or white.
197
197
  */
198
- static invertColor(hex: string, bw?: boolean): string;
198
+ static invertColor(hex: string | null | undefined, bw?: boolean): string;
199
199
  /**
200
200
  * Convert RGB to array [r, g, b]
201
201
  *
@@ -145,7 +145,7 @@ export class Utils {
145
145
  /** Allow using spaces in name (by edit) */
146
146
  noTrim) {
147
147
  const item = obj;
148
- let text = (obj && obj._id) || '';
148
+ let text = obj?._id || '';
149
149
  if (typeof settings === 'string' && !options) {
150
150
  options = { language: settings };
151
151
  settings = null;
@@ -972,7 +972,7 @@ export class Utils {
972
972
  * @param bw Set to black or white.
973
973
  */
974
974
  static invertColor(hex, bw) {
975
- if (hex === undefined || hex === null || hex === '' || typeof hex !== 'string') {
975
+ if (!hex || typeof hex !== 'string') {
976
976
  return '';
977
977
  }
978
978
  if (hex.startsWith('rgba')) {