schnee effeckt und fehler Korektur

This commit is contained in:
2023-08-14 17:52:24 +02:00
parent 4a843d4936
commit 79af4e9907
6813 changed files with 343821 additions and 356128 deletions

53
node_modules/imagemin-svgo/index.js generated vendored
View File

@@ -1,47 +1,18 @@
'use strict';
const isSvg = require('is-svg');
const {optimize} = require('svgo');
var isSvg = require('is-svg');
var SVGO = require('svgo');
var through = require('through2');
module.exports = options => async buffer => {
options = {multipass: true, ...options};
module.exports = function (opts) {
opts = opts || {};
if (!isSvg(buffer)) {
return Promise.resolve(buffer);
}
return through.ctor({objectMode: true}, function (file, enc, cb) {
if (file.isNull()) {
cb(null, file);
return;
}
if (Buffer.isBuffer(buffer)) {
buffer = buffer.toString();
}
if (file.isStream()) {
cb(new Error('Streaming is not supported'));
return;
}
if (!isSvg(file.contents)) {
cb(null, file);
return;
}
try {
var svgo = new SVGO(opts);
svgo.optimize(file.contents.toString('utf8'), function (res) {
if (!res.data || !res.data.length) {
return;
}
res.data = res.data.replace(/&(?!amp;)/g, '&');
res.data = new Buffer(res.data);
file.contents = res.data;
});
} catch (err) {
err.fileName = file.path;
cb(err);
return;
}
cb(null, file);
});
const {data} = optimize(buffer, options);
return Buffer.from(data);
};