Comparing version 0.2.4 to 0.2.5
@@ -28,2 +28,23 @@ /* | ||
Tapable.prototype.applyPlugins0 = function applyPlugins0(name) { | ||
var plugins = this._plugins[name]; | ||
if(!plugins) return; | ||
for(var i = 0; i < plugins.length; i++) | ||
plugins[i].call(this); | ||
}; | ||
Tapable.prototype.applyPlugins1 = function applyPlugins1(name, param) { | ||
var plugins = this._plugins[name]; | ||
if(!plugins) return; | ||
for(var i = 0; i < plugins.length; i++) | ||
plugins[i].call(this, param); | ||
}; | ||
Tapable.prototype.applyPlugins2 = function applyPlugins2(name, param1, param2) { | ||
var plugins = this._plugins[name]; | ||
if(!plugins) return; | ||
for(var i = 0; i < plugins.length; i++) | ||
plugins[i].call(this, param1, param2); | ||
}; | ||
Tapable.prototype.applyPluginsWaterfall = function applyPluginsWaterfall(name, init) { | ||
@@ -71,7 +92,7 @@ if(!this._plugins[name]) return init; | ||
Tapable.prototype.applyPluginsAsyncSeries = Tapable.prototype.applyPluginsAsync = function applyPluginsAsync(name) { | ||
Tapable.prototype.applyPluginsAsyncSeries = Tapable.prototype.applyPluginsAsync = function applyPluginsAsyncSeries(name) { | ||
var args = Array.prototype.slice.call(arguments, 1); | ||
var callback = args.pop(); | ||
if(!this._plugins[name] || this._plugins[name].length === 0) return callback(); | ||
var plugins = this._plugins[name]; | ||
if(!plugins || plugins.length === 0) return callback(); | ||
var i = 0; | ||
@@ -90,2 +111,18 @@ var _this = this; | ||
Tapable.prototype.applyPluginsAsyncSeries1 = function applyPluginsAsyncSeries1(name, param, callback) { | ||
var plugins = this._plugins[name]; | ||
if(!plugins || plugins.length === 0) return callback(); | ||
var i = 0; | ||
var _this = this; | ||
var innerCallback = copyProperties(callback, function next(err) { | ||
if(err) return callback(err); | ||
i++; | ||
if(i >= plugins.length) { | ||
return callback(); | ||
} | ||
plugins[i].call(_this, param, innerCallback); | ||
}); | ||
plugins[0].call(this, param, innerCallback); | ||
}; | ||
Tapable.prototype.applyPluginsAsyncSeriesBailResult = function applyPluginsAsyncSeriesBailResult(name) { | ||
@@ -92,0 +129,0 @@ var args = Array.prototype.slice.call(arguments, 1); |
{ | ||
"name": "tapable", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "Just a little module for plugins.", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17974
387