isDate.js 225 B

12345
  1. import { getType } from './getType.js';
  2. /** Returns whether the payload is a Date, and that the date is valid */
  3. export function isDate(payload) {
  4. return getType(payload) === 'Date' && !Number.isNaN(payload.valueOf());
  5. }