trimObj = function (obj, removeFalse = false) {
  if (null == obj || typeof obj !== 'object') return obj
  const attrs = (typeof window.structuredClone === 'function') ? window.structuredClone(obj) : Object.assign({}, obj)
  /** @type {(null|undefined|''|false)[]} xmlRemove */
  const xmlRemove = [null, undefined, '']
  if (removeFalse) {
    xmlRemove.push(false)
  }
  for (const attr in attrs) {
    if (xmlRemove.includes(attrs[attr])) {
      delete attrs[attr]
    } else if (Array.isArray(attrs[attr])) {
      if (!attrs[attr].length) {
        delete attrs[attr]
      }
    }
  }

  return attrs
}
Remove null, undefined, empty string or empty array values from an object, original object is not modified
@param  {Object} obj {attrName: attrValue}
@param {boolean} [removeFalse=false] Remove values === false
@return {Object} Object trimmed of null or undefined values