code: function merge(target, source) {
      if (source === null) {
          return target
      }
      var props = Object.getOwnPropertyNames(target)
      props.forEach(function (name) {
          var s = gettype(source[name])
          if (s !== 'undefined') {
              var t = gettype(target[name])
              if (t !== s) {
                  throw new Error(`Type mismatch between '${t}' and '${s}' for '${name}'`)
              }
              if (t === 'object') {
                  merge(target[name], source[name])
              } else {
                  target[name] = source[name]
              }
          }
      })
      return target
  }
docs: Merges the source with the target. The target is modified and returned.