code: function extend(target, 
  // tslint:disable-next-line:trailing-comma
  ...sources) {
      if (target == null)
          target = {};
      for (const source of sources) {
          for (const [prop, val] of entries(source)) {
              if (val === null) {
                  // copy null values
                  target[prop] = val;
              }
              else if (typeof target[prop] === "object" && typeof val === "object") {
                  // merge objects if both properties are objects
                  target[prop] = extend(target[prop], val);
              }
              else if (typeof val === "object") {
                  // create a copy of the source object if the target is primitive
                  target[prop] = extend({}, val);
              }
              else {
                  // copy primitive values
                  target[prop] = val;
              }
          }
      }
      return target;
  }
docs: Deep merges multiple objects onto the target object.
  This modifies the target object, so pass undefined or {}
  to create a new object.