tapable
Advanced tools
Comparing version 1.0.0-beta.0 to 1.0.0-beta.1
@@ -94,2 +94,18 @@ /* | ||
withOptions(options) { | ||
const mergeOptions = opt => Object.assign({}, options, typeof opt === "string" ? { name: opt } : opt); | ||
// Prevent creating endless prototype chains | ||
options = Object.assign({}, this._withOptions); | ||
const base = this._withOptionsBase || this; | ||
const newHook = Object.create(base); | ||
newHook.tapAsync = (opt, fn) => base.tapAsync(mergeOptions(opt), fn), | ||
newHook.tap = (opt, fn) => base.tap(mergeOptions(opt), fn); | ||
newHook.tapPromise = (opt, fn) => base.tapPromise(mergeOptions(opt), fn); | ||
newHook._withOptions = options; | ||
newHook._withOptionsBase = options; | ||
return newHook; | ||
} | ||
isUsed() { | ||
@@ -96,0 +112,0 @@ return this.taps.length > 0 || this.interceptors.length > 0; |
{ | ||
"name": "tapable", | ||
"version": "1.0.0-beta.0", | ||
"version": "1.0.0-beta.1", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "Just a little module for plugins.", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
244474
3571
0