mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Remove Thenable
This commit is contained in:
@@ -7,8 +7,7 @@
|
||||
],
|
||||
"outDir": "../../out",
|
||||
"types": [
|
||||
"../../node_modules/@types/mocha",
|
||||
"../vs/typings/thenable.d.ts"
|
||||
"../../node_modules/@types/mocha"
|
||||
],
|
||||
"baseUrl": "..",
|
||||
"paths": {
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Vendored
-12
@@ -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> { }
|
||||
Reference in New Issue
Block a user