Asserts that the input is a Date object.
An error if the input is not a Date object.
const fn = (x: unknown) => { assertIsDate(x); return x; // x has inferred type Date}; Copy
const fn = (x: unknown) => { assertIsDate(x); return x; // x has inferred type Date};
The input value to be asserted.
Asserts that the input is a Date object.
Throws
An error if the input is not a Date object.
Example