An error with message "Expected an object" if the input is not an object.
Example
constfn = (x: Date | { foo: string} | number | string) => { assertIsObject(x); returnx; // x has inferred type Date | { foo: string } as both comply with object type };
Asserts that the input is an object.
Throws
An error with message "Expected an object" if the input is not an object.
Example