mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[is-promise] add linting (#18865)
This commit is contained in:
parent
3ca58c26e4
commit
2692c4f925
4
types/is-promise/index.d.ts
vendored
4
types/is-promise/index.d.ts
vendored
@ -1,8 +1,8 @@
|
||||
// Type definitions for is-promise
|
||||
// Type definitions for is-promise 2.1
|
||||
// Project: https://github.com/then/is-promise
|
||||
// Definitions by: Daniel Rosenwasser <https://github.com/DanielRosenwasser>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = isPromise;
|
||||
|
||||
declare function isPromise(obj: any): obj is PromiseLike<any>;
|
||||
declare function isPromise(obj: any): obj is PromiseLike<any>;
|
||||
|
||||
@ -1,15 +1,14 @@
|
||||
import isPromise = require("is-promise");
|
||||
|
||||
isPromise({ then() { }});
|
||||
isPromise({ then() {} });
|
||||
isPromise(null);
|
||||
isPromise({ });
|
||||
isPromise({});
|
||||
isPromise({then: true});
|
||||
|
||||
function f(x: number | PromiseLike<number>) {
|
||||
if (isPromise(x)) {
|
||||
x.then;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
x.toExponential;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
types/is-promise/tslint.json
Normal file
1
types/is-promise/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user