function setUserProperties(srcUserProperties, properties) {
        if (srcUserProperties && typeof srcUserProperties == "object") {
            let _clone = {};
            let count = 0;
            let keys = Object.keys(srcUserProperties);
            if(!keys || !keys.length) return null;
            keys.forEach(key => {
                let val = srcUserProperties[key];
                if(typeof val === "string") {
                    count++;
                    _clone[key] = val;
                } else if (val !== undefined && val !== null) {
                    try {
                        _clone[key] = JSON.stringify(val)
                        count++;
                    } catch  (err) {
                        // Silently drop property
                    }
                }
            });
            if(count) properties.userProperties = _clone;
        }
    }
Helper function for copying the MQTT v5 srcUserProperties object (parameter1) to the properties object (parameter2).
Any property in srcUserProperties that is NOT a key/string pair will be silently discarded.
NOTE: if no sutable properties are present, the userProperties object will NOT be added to the properties object
@param {object} srcUserProperties An object with key/value string pairs
@param {object} properties A properties object in which userProperties will be copied to