diff options
author | 2020-11-18 23:26:45 +0100 | |
---|---|---|
committer | 2020-11-18 23:26:45 +0100 | |
commit | 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch) | |
tree | 8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/tapable/lib/Tapable.js | |
parent | 1870f3fdf43707a15fda0f609a021f516f45eb63 (diff) | |
download | website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2 website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip |
rm node_modules
Diffstat (limited to 'node_modules/tapable/lib/Tapable.js')
-rw-r--r-- | node_modules/tapable/lib/Tapable.js | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/node_modules/tapable/lib/Tapable.js b/node_modules/tapable/lib/Tapable.js deleted file mode 100644 index 530fea3..0000000 --- a/node_modules/tapable/lib/Tapable.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const util = require("util"); -const SyncBailHook = require("./SyncBailHook"); - -function Tapable() { - this._pluginCompat = new SyncBailHook(["options"]); - this._pluginCompat.tap( - { - name: "Tapable camelCase", - stage: 100 - }, - options => { - options.names.add( - options.name.replace(/[- ]([a-z])/g, (str, ch) => ch.toUpperCase()) - ); - } - ); - this._pluginCompat.tap( - { - name: "Tapable this.hooks", - stage: 200 - }, - options => { - let hook; - for (const name of options.names) { - hook = this.hooks[name]; - if (hook !== undefined) { - break; - } - } - if (hook !== undefined) { - const tapOpt = { - name: options.fn.name || "unnamed compat plugin", - stage: options.stage || 0 - }; - if (options.async) hook.tapAsync(tapOpt, options.fn); - else hook.tap(tapOpt, options.fn); - return true; - } - } - ); -} -module.exports = Tapable; - -Tapable.addCompatLayer = function addCompatLayer(instance) { - Tapable.call(instance); - instance.plugin = Tapable.prototype.plugin; - instance.apply = Tapable.prototype.apply; -}; - -Tapable.prototype.plugin = util.deprecate(function plugin(name, fn) { - if (Array.isArray(name)) { - name.forEach(function(name) { - this.plugin(name, fn); - }, this); - return; - } - const result = this._pluginCompat.call({ - name: name, - fn: fn, - names: new Set([name]) - }); - if (!result) { - throw new Error( - `Plugin could not be registered at '${name}'. Hook was not found.\n` + - "BREAKING CHANGE: There need to exist a hook at 'this.hooks'. " + - "To create a compatibility layer for this hook, hook into 'this._pluginCompat'." - ); - } -}, "Tapable.plugin is deprecated. Use new API on `.hooks` instead"); - -Tapable.prototype.apply = util.deprecate(function apply() { - for (var i = 0; i < arguments.length; i++) { - arguments[i].apply(this); - } -}, "Tapable.apply is deprecated. Call apply on the plugin directly instead"); |