mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
TypeScript annotation fixes
This commit is contained in:
@@ -50,7 +50,7 @@ interface WebpackConfigFunc {
|
|||||||
type WebpackConfigExport = WebpackConfigOrArrayOrThenable | WebpackConfigFunc;
|
type WebpackConfigExport = WebpackConfigOrArrayOrThenable | WebpackConfigFunc;
|
||||||
type WebpackConfigModuleExports = WebpackConfigExport | EsModuleExports<WebpackConfigExport>;
|
type WebpackConfigModuleExports = WebpackConfigExport | EsModuleExports<WebpackConfigExport>;
|
||||||
|
|
||||||
function isThenable(obj: any) {
|
function isThenable<T>(obj: any): obj is Thenable<T> {
|
||||||
return obj && typeof (<Thenable<any>>obj).then === 'function';
|
return obj && typeof (<Thenable<any>>obj).then === 'function';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,7 +262,7 @@ export function createWebpackDevServer(callback: CreateDevServerCallback, option
|
|||||||
webpackConfigExport = webpackConfigExport(options.suppliedOptions.EnvParam);
|
webpackConfigExport = webpackConfigExport(options.suppliedOptions.EnvParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
const webpackConfigThenable = isThenable(webpackConfigExport)
|
const webpackConfigThenable: Thenable<WebpackConfigOrArray> = isThenable(webpackConfigExport)
|
||||||
? webpackConfigExport
|
? webpackConfigExport
|
||||||
: { then: callback => callback(webpackConfigExport) };
|
: { then: callback => callback(webpackConfigExport) };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user