import { Extends } from '../../commonness/Extends'; import { If } from '../../commonness/If'; /** * * Convert a union type to an object * * 유니온 타입을 객체로 변환하는 타입 * * @param T Union type / 유니온 타입 * * @returns Object / 객체 * * @example * type cases = [ * Expect, { a: 'a'; b: 'b'; c: 'c' }>>, * Expect, { a: 'a' }>>, * Expect, { [x: string]: string }>>, * Expect, { a: 'a'; 1: 1 }>>, * Expect, {}>>, * ] * * @link https://www.utilscript.site/docs/usage-union/to-object * */ export type ToObject = { [K in T as If, K, never>]: K; };