klren0312 / daliy_knowledge

知识积累,正确使用方式是watch
21 stars 4 forks source link

ts中使用Object.keys(), 返回值类型问题 #798

Open klren0312 opened 11 months ago

klren0312 commented 11 months ago
const keys = Object.keys as <T>(obj: T) =>
    (keyof T extends infer U ? U extends string ? U : U extends number ? `${U}` : never : never)[]