diff options
author | uki00a <uki00a@gmail.com> | 2020-04-28 02:39:39 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-27 13:39:39 -0400 |
commit | d440495b6bc20eb8008397f3c744d8fa1ab578f5 (patch) | |
tree | 25c8114e6ead31a5154a78bfd9455b6317b40942 /cli/js/web/util.ts | |
parent | 62976a1c948e35e14a518e0134d20b497f8f9910 (diff) |
fix(console): don't throw RangeError when an invalid date is passed (#4929)
Diffstat (limited to 'cli/js/web/util.ts')
-rw-r--r-- | cli/js/web/util.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/js/web/util.ts b/cli/js/web/util.ts index 824d00d4b..0ab367554 100644 --- a/cli/js/web/util.ts +++ b/cli/js/web/util.ts @@ -19,6 +19,11 @@ export function isTypedArray(x: unknown): x is TypedArray { } // @internal +export function isInvalidDate(x: Date): boolean { + return isNaN(x.getTime()); +} + +// @internal export function requiredArguments( name: string, length: number, |