(value: unknown)
| 1 | export function isDate(value: unknown): value is Date { |
| 2 | return ( |
| 3 | value instanceof Date || |
| 4 | // date created in other JS context (for example, worker) |
| 5 | Object.prototype.toString.call(value) === '[object Date]' |
| 6 | ) |
| 7 | } |
| 8 | |
| 9 | export function isValidDate(date: Date) { |
| 10 | return date.toString() !== 'Invalid Date' |
no outgoing calls
no test coverage detected