function getArrayType(arr) {
  if (arr.length > 0) {
    const firstValueType = getTypeScriptType(arr[0]);
    if (arr.every((v) => getTypeScriptType(v) === firstValueType)) {
      return firstValueType + '[]';
    } else {
      return `(${Array.from(
        new Set(
          arr.map((item, index) => {
            const isLast = arr.length === index + 1;
            return `${getTypeScriptType(item)}${!isLast ? ' | ' : ''}`;
          }),
        ),
      ).join('')})[]`;
    }
  }
  return 'any[]';
}
@param {any[]} arr An array to check each property of
@returns {String} A valid type for the passed array and it's items