Remove Thenable

This commit is contained in:
Daniel Imms
2025-09-17 15:02:27 -07:00
parent 8ffcbd98c4
commit 90bf20d9d8
3 changed files with 2 additions and 15 deletions
+1 -2
View File
@@ -7,8 +7,7 @@
],
"outDir": "../../out",
"types": [
"../../node_modules/@types/mocha",
"../vs/typings/thenable.d.ts"
"../../node_modules/@types/mocha"
],
"baseUrl": "..",
"paths": {
+1 -1
View File
@@ -124,7 +124,7 @@ export function raceTimeout<T>(promise: Promise<T>, timeout: number, onTimeout?:
]);
}
export function asPromise<T>(callback: () => T | Thenable<T>): Promise<T> {
export function asPromise<T>(callback: () => T | PromiseLike<T>): Promise<T> {
return new Promise<T>((resolve, reject) => {
const item = callback();
if (isThenable<T>(item)) {
-12
View File
@@ -1,12 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
* and others. This API makes no assumption about what promise library is being used which
* enables reusing existing code without migrating to a specific promise implementation. Still,
* we recommend the use of native promises which are available in VS Code.
*/
interface Thenable<T> extends PromiseLike<T> { }