/** * * Convert a string to a union of its characters * * 문자열을 문자의 유니온으로 변환 * * @param T String / 문자열 * * @returns Union of characters / 문자의 유니온 * * @example * type cases = [ * Expect, never>>, * Expect, 't'>>, * Expect, 'h' | 'e' | 'l' | 'l' | 'o'>>, * Expect, 'c' | 'o' | 'r' | 'o' | 'n' | 'a' | 'v' | 'i' | 'r' | 'u' | 's'>>, * ] * * @link https://www.utilscript.site/docs/usage-string/to-union * */ export type ToUnion = T extends '' ? never : T extends `${infer First}${infer Rest}` ? First | ToUnion : T;