const setIntervalImmediately = (fn, duration) =>
  setInterval((() => (fn(), fn))(), duration);

function formatImgSrc(srcArr) {
  if (Array.isArray(srcArr) && srcArr.length > 0) {
    return srcArr[0] ?? "";
  }
  return "";
}
export { setIntervalImmediately, formatImgSrc };
