aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/src/internal/util/isDate.ts
blob: ed09ffb6a24d544b6dc6e7a15c49f36730c2f0d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
/**
 * Checks to see if a value is not only a `Date` object,
 * but a *valid* `Date` object that can be converted to a
 * number. For example, `new Date('blah')` is indeed an
 * `instanceof Date`, however it cannot be converted to a
 * number.
 */
export function isValidDate(value: any): value is Date {
  return value instanceof Date && !isNaN(value as any);
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage