Server IP : 162.213.251.212 / Your IP : 3.141.27.108 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/home/allssztx/public_html/easybuyer/node_modules/svgo/lib/svgo/ |
Upload File : |
'use strict'; /** * Plugins engine. * * @module plugins * * @param {Object} data input data * @param {Object} info extra information * @param {Object} plugins plugins object from config * @return {Object} output data */ module.exports = function(data, info, plugins) { plugins.forEach(function(group) { switch(group[0].type) { case 'perItem': data = perItem(data, info, group); break; case 'perItemReverse': data = perItem(data, info, group, true); break; case 'full': data = full(data, info, group); break; } }); return data; }; /** * Direct or reverse per-item loop. * * @param {Object} data input data * @param {Object} info extra information * @param {Array} plugins plugins list to process * @param {Boolean} [reverse] reverse pass? * @return {Object} output data */ function perItem(data, info, plugins, reverse) { function monkeys(items) { items.content = items.content.filter(function(item) { // reverse pass if (reverse && item.content) { monkeys(item); } // main filter var filter = true; for (var i = 0; filter && i < plugins.length; i++) { var plugin = plugins[i]; if (plugin.active && plugin.fn(item, plugin.params, info) === false) { filter = false; } } // direct pass if (!reverse && item.content) { monkeys(item); } return filter; }); return items; } return monkeys(data); } /** * "Full" plugins. * * @param {Object} data input data * @param {Object} info extra information * @param {Array} plugins plugins list to process * @return {Object} output data */ function full(data, info, plugins) { plugins.forEach(function(plugin) { if (plugin.active) { data = plugin.fn(data, plugin.params, info); } }); return data; }