How to discriminate type and array of type in typescript?

前端 未结 0 437
小蘑菇
小蘑菇 2021-02-06 23:25

In typescript, how can I discriminate between a user defined type and an array of such type?

type SomeType = { foo: string; };

function doSomething(x: SomeType |         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题