From a39c846c785c3ac56f96a7ebaebafa1d9ba516eb Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 25 Jun 2018 16:23:40 +0200 Subject: [PATCH] Cast dependency.constructor to correct type --- lib/Compilation.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Compilation.js b/lib/Compilation.js index 0bbe006cb..e31eba968 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -915,11 +915,8 @@ class Compilation extends Tapable { ) { throw new Error("Parameter 'dependency' must be a Dependency"); } - // @ts-ignore - // TODO: Not sure how to handle the - // dependency.constructor error, - // maybe I typed it wrong - const moduleFactory = this.dependencyFactories.get(dependency.constructor); + const Dep = /** @type {DepConstructor} */ (dependency.constructor); + const moduleFactory = this.dependencyFactories.get(Dep); if (!moduleFactory) { throw new Error( `No dependency factory available for this dependency type: ${