I wonder what do you folks think is the best way to check for an object. I reckon these objects:
- {}
- {foo: string}
and these - not: - () => 1
- number[]
- {foo: string}[]
Do you think this would be most reasonable:
type IsObject<T> = T extends object
? T extends any[]
? false
: T extends Function
? false
: true
: false;