字符串数组转换ts类型m|n 类型体操?-灵析社区

MastFancy

type A = T extends any[] ? T[number] : T; 数组转联合类型用 [number] 作为下标 `['1', '2']['number'] // '1' | '2'`

阅读量:1

点赞量:0

问AI