MCPcopy
hub / github.com/Koenkk/zigbee2mqtt / interpretValue

Function interpretValue

lib/util/settings.ts:334–342  ·  view source on GitHub ↗
(value: T)

Source from the content-addressed store, hash-verified

332
333 // Read !secret MQTT username and password if set
334 const interpretValue = <T>(value: T): T => {
335 if (typeof value === "string") {
336 const ref = parseValueRef(value);
337 if (ref) {
338 return yaml.read(data.joinPath(ref.filename))[ref.key];
339 }
340 }
341 return value;
342 };
343
344 if (s.mqtt?.user) {
345 s.mqtt.user = interpretValue(s.mqtt.user);

Callers 1

readFunction · 0.85

Calls 1

parseValueRefFunction · 0.85

Tested by

no test coverage detected