/**
 * This component has been migrated to the Duo-UI library (https://gitlab.com/gitlab-org/duo-ui).
 *
 * Please use the corresponding component in Duo-UI going forward.
 * All future development and maintenance for Duo components should take place in Duo-UI.
 *
 * For more details, see the migration epic: https://gitlab.com/groups/gitlab-org/-/epics/15344 or reach out to the Duo-Chat team in #g_duo_chat.
 */

const concatUntilEmpty = arr => {
  if (!arr) return '';
  let end = arr.findIndex(el => !el);
  if (end < 0) end = arr.length;
  return arr.slice(0, end).join('');
};

export { concatUntilEmpty };
