merge = (mainPlugins, newPlugins) => {
  const res = Array.isArray(mainPlugins)
    ? mainPlugins.slice(0, mainPlugins.length)
    : '';

  for (const el of Array.isArray(newPlugins) ? newPlugins : []) {
    let index = null;
    for (const i in res) {
      if (
        el.name !== null
        && res[i].name.toLowerCase() === el.name.toLowerCase()
      ) {
        index = i;
        break;
      }
    }
    if (index === null) {
      res.push(el);
    } else {
      res[index] = el;
    }
  }

  return res;
}
Merge two plugins options lists
@param {array} mainPlugins
@param {array} newPlugins