import { Equal } from '../../commonness/Equal'; import { Push } from '../Push'; import { Length } from '../Length'; import { Tuple } from '../../primitive/Tuple'; /** * * Type that takes an array and a value and returns the last index of the value in the array * * 튜플과 값을 받아 튜플에서 해당 값의 마지막 인덱스를 반환하는 타입 * * @params T - Array to search / 검색할 튜플 * * @params U - Value to search for / 검색할 값 * * @returns Last index of the value in the array / 튜플에서 해당 값의 마지막 인덱스 * * @example * type cases = [ * Expect, 3>>, * Expect, 7>>, * Expect, -1>>, * Expect, 4>>, * Expect, 5>>, * ]; * * @link https://www.utilscript.site/docs/usage-array/last-index-of * */ export type LastIndexOf = T extends readonly [infer Current, ...infer Rest] ? Equal extends true ? LastIndexOf, Length> : LastIndexOf, R> : R;