Type alias IsDate<T>

IsDate<T>: IsAny<T> extends true
    ? true
    : T extends Date | {
            $date: number;
        }
        ? true
        : false

Checks if a type can possibly be a date

Type Parameters

  • T

Example

IsDate<string | Date> === boolean