/*!
 * (C) Gasco https://gasco-web-component.herokuapp.com/ - MIT License
 */
export const setupConfig = (config) => {
  const win = window;
  const Gasco = win.Gasco;
  // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
  if (Gasco && Gasco.config && Gasco.config.constructor.name !== 'Object') {
    return;
  }
  win.Gasco = win.Gasco || {};
  win.Gasco.config = Object.assign(Object.assign({}, win.Gasco.config), config);
  return win.Gasco.config;
};
