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 |