mirror of https://github.com/node-red/node-red.git
Convert to string
parent
e3acc49d5e
commit
a0b4fc8372
|
@ -161,9 +161,13 @@ module.exports = function(RED) {
|
||||||
if(typeof val === "string") {
|
if(typeof val === "string") {
|
||||||
count++;
|
count++;
|
||||||
_clone[key] = val;
|
_clone[key] = val;
|
||||||
} else if (typeof val === "number") {
|
} else {
|
||||||
count++;
|
count++;
|
||||||
_clone[key] = val.toString();
|
try {
|
||||||
|
_clone[key] = JSON.stringify(val)
|
||||||
|
} catch (err) {
|
||||||
|
console.log('MQTT v5 Property value can not be converted to a String')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(count) properties.userProperties = _clone;
|
if(count) properties.userProperties = _clone;
|
||||||
|
|
Loading…
Reference in New Issue