36. 字符串转联合类型

中等0

实现一个通用工具类型 StringToUnion<T> ,接收 string 参数并转换为一个字母联合的类型。

例如:

type Test = '123';
type Result = StringToUnion<Test>; // expected to be "1" | "2" | "3"
评论(0)
题库

TypeScript

加载中...