Allow msg.userProperties to have number values

fixes #4899
This commit is contained in:
Ben Hardill 2024-10-01 16:31:28 +01:00
parent 674eb36e15
commit e3acc49d5e
No known key found for this signature in database
GPG Key ID: 74DD076979ABB1E7

View File

@ -158,9 +158,12 @@ module.exports = function(RED) {
if(!keys || !keys.length) return null;
keys.forEach(key => {
let val = srcUserProperties[key];
if(typeof val == "string") {
if(typeof val === "string") {
count++;
_clone[key] = val;
} else if (typeof val === "number") {
count++;
_clone[key] = val.toString();
}
});
if(count) properties.userProperties = _clone;