'use strict';

/*!
 * @techmely/utils
 * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com>
 * MIT Licensed
 */


// src/firstUniqueArray.ts
function firstUniqueArr(array) {
  if (!array || array?.length === 0)
    return void 0;
  const arrLength = array.length;
  if (array.length === 1)
    return array[0];
  for (let i = 0; i < arrLength; i++) {
    const element = array[i];
    if (array.indexOf(element) === array.lastIndexOf(element))
      return element;
  }
  return void 0;
}

exports.firstUniqueArr = firstUniqueArr;
