Added types for compatability

This commit is contained in:
Adam Zerella
2019-03-12 16:56:44 +11:00
committed by Adam A. Zerella
parent bf6faee70d
commit fb7e15e59d
6 changed files with 57 additions and 2 deletions
+2 -2
View File
@@ -2,10 +2,10 @@
// Project: https://github.com/ljharb/is-date-object
// Definitions by: Adam Zerella <https://github.com/adamzerella>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.3
// TypeScript Version: 3.0
declare function isDateObject(value: Date): true;
declare function isDateObject(value?: object): boolean;
declare function isDateObject(value?: null | boolean | string | number | symbol | bigint | []): false;
declare function isDateObject(value?: null | boolean | string | number | []): false;
export = isDateObject;
+7
View File
@@ -0,0 +1,7 @@
{
"private": true,
"types": "index",
"typesVersions": {
">=3.2.0-0": { "*": ["ts3.2/*"] }
}
}
+5
View File
@@ -0,0 +1,5 @@
declare function isDateObject(value: Date): true;
declare function isDateObject(value: object): boolean;
declare function isDateObject(value: undefined | null | boolean | string | number | symbol | bigint | []): false;
export = isDateObject;
@@ -0,0 +1,15 @@
import isDate = require("is-date-object");
isDate();
isDate(undefined);
isDate(null);
isDate(false);
isDate(true);
isDate(42);
isDate('foo');
isDate((): void => {});
isDate([]);
isDate({});
isDate(/a/g);
isDate(new RegExp('a', 'g'));
isDate(new Date());
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../../",
"typeRoots": [
"../../"
],
"types": [
],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"is-date-object-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}