aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/src/internal/util/isDate.ts
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/rxjs/src/internal/util/isDate.ts')
-rw-r--r--node_modules/rxjs/src/internal/util/isDate.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/node_modules/rxjs/src/internal/util/isDate.ts b/node_modules/rxjs/src/internal/util/isDate.ts
new file mode 100644
index 0000000..ed09ffb
--- /dev/null
+++ b/node_modules/rxjs/src/internal/util/isDate.ts
@@ -0,0 +1,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