From 462c6f2a82f59451f91fe3372928c5dd70edb3cf Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Wed, 6 Mar 2019 16:17:47 +1100 Subject: [PATCH] Updated any type to unknown --- types/is-date-object/index.d.ts | 7 ++++++- types/is-date-object/is-date-object-tests.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/is-date-object/index.d.ts b/types/is-date-object/index.d.ts index 08885dce51..4564b5e34b 100644 --- a/types/is-date-object/index.d.ts +++ b/types/is-date-object/index.d.ts @@ -2,7 +2,12 @@ // Project: https://github.com/ljharb/is-date-object // Definitions by: Adam Zerella // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.3 -declare function isDateObject(value?: any): boolean; +type InvalidTypes = undefined | null | boolean | string | number | [] | {}; + +declare function isDateObject(value: Date): true; +declare function isDateObject(value: InvalidTypes | unknown): false; +declare function isDateObject(value?: unknown): false; export = isDateObject; diff --git a/types/is-date-object/is-date-object-tests.ts b/types/is-date-object/is-date-object-tests.ts index 68fb22d684..9946c42d54 100644 --- a/types/is-date-object/is-date-object-tests.ts +++ b/types/is-date-object/is-date-object-tests.ts @@ -7,6 +7,7 @@ isDate(false); isDate(true); isDate(42); isDate('foo'); +isDate((): void => {}); isDate([]); isDate({}); isDate(/a/g);