mergeOptionsOfItems = function(items) {
  /** @type {T[]} */
  const mergedItems = [];

  for (const item of items) {
    const existingItem = item.path && mergedItems.find(candidate => candidate.path === item.path);
    if (!existingItem) {
      mergedItems.push(item);
      continue;
    }

    existingItem.options = Object.assign({}, existingItem.options, item.options);
  }

  return mergedItems;
}
If any items with identical `path` properties are found in the input array,
merge their `options` properties into the first instance and then discard any
other instances.
@template {{path?: string, options: Record<string, unknown>}} T
@param {T[]} items
@return T[]