From acfb72eaac193ddd38b9aab67608b731b876e439 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Tue, 9 Jul 2019 14:55:12 +0200 Subject: [PATCH] add name to hook interface --- lib/Hook.js | 1 + tapable.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/Hook.js b/lib/Hook.js index e9901de..55149f8 100644 --- a/lib/Hook.js +++ b/lib/Hook.js @@ -103,6 +103,7 @@ class Hook { Object.assign({}, options, typeof opt === "string" ? { name: opt } : opt); return { + name: this.name, tap: (opt, fn) => this.tap(mergeOptions(opt), fn), tapAsync: (opt, fn) => this.tapAsync(mergeOptions(opt), fn), tapPromise: (opt, fn) => this.tapPromise(mergeOptions(opt), fn), diff --git a/tapable.d.ts b/tapable.d.ts index c8773fb..d3e7834 100644 --- a/tapable.d.ts +++ b/tapable.d.ts @@ -43,6 +43,7 @@ type ArgumentNames = FixedSizeArray; declare class Hook { constructor(args?: ArgumentNames>, name?: string); + name: string | undefined; intercept(interceptor: HookInterceptor>): void; isUsed(): boolean; callAsync(...args: Append, Callback>): void;