import { Tuple } from '../../primitive'; import { MatchReadonly } from '../MatchReadonly'; /** * * Type to remove the last element from an array * * 배열의 마지막 요소를 제거하는 타입 * * @param T Tuple / 튜플 * * @returns Popped tuple / 제거된 튜플 * * @example * type cases = [ * Expect, [3, 2]>>, * Expect, ['a', 'b', 'c']>>, * Expect, []>>, * ] * * @link https://www.utilscript.site/docs/usage-array/pop * */ export type Pop = T extends [...infer First, unknown] ? First : T extends readonly [...infer ReadonlyFirst, unknown] ? readonly [...ReadonlyFirst] : MatchReadonly;