An error with message 'Expected a plain object' if the input is not a plain object.
Example
constfn = (x: Date | { foo: string } | number | string) => { assertIsPlainObject(x); returnx; // x has inferred type { foo: string } as it is the only plain object };
Asserts that the input is a plain object.
Throws
An error with message 'Expected a plain object' if the input is not a plain object.
Example