function merge(a, b) {
  if (!a) {
    a = {};
  }

  if (b) {
    for (const name in b) {
      if (Object.prototype.hasOwnProperty.call(b, name)) {
        if (typeof b[name] === "object") {
          a[name] = merge(a[name], b[name]);
        } else {
          a[name] = b[name];
        }
      }
    }
  }
  return a;
}
Merge all options of object b into object b
@param {object} a - The object to be modified and returned.
@param {object} b - The source of properties.
@returns {object} a

Adapted merge() in dotparser.js