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

45
node_modules/filenamify/index.js generated vendored
View File

@@ -1,43 +1,46 @@
'use strict';
var path = require('path');
var trimRepeated = require('trim-repeated');
var filenameReservedRegex = require('filename-reserved-regex');
var stripOuter = require('strip-outer');
const path = require('path');
const trimRepeated = require('trim-repeated');
const filenameReservedRegex = require('filename-reserved-regex');
const stripOuter = require('strip-outer');
// doesn't make sense to have longer filenames
var MAX_FILENAME_LENGTH = 100;
// Doesn't make sense to have longer filenames
const MAX_FILENAME_LENGTH = 100;
var reControlChars = /[\x00-\x1f\x80-\x9f]/g;
var reRelativePath = /^\.+/;
const reControlChars = /[\u0000-\u001f\u0080-\u009f]/g; // eslint-disable-line no-control-regex
const reRelativePath = /^\.+/;
var fn = module.exports = function (str, opts) {
if (typeof str !== 'string') {
const fn = (string, options) => {
if (typeof string !== 'string') {
throw new TypeError('Expected a string');
}
opts = opts || {};
options = options || {};
var replacement = opts.replacement || '!';
const replacement = options.replacement === undefined ? '!' : options.replacement;
if (filenameReservedRegex().test(replacement) && reControlChars.test(replacement)) {
throw new Error('Replacement string cannot contain reserved filename characters');
}
str = str.replace(filenameReservedRegex(), replacement);
str = str.replace(reControlChars, replacement);
str = str.replace(reRelativePath, replacement);
string = string.replace(filenameReservedRegex(), replacement);
string = string.replace(reControlChars, replacement);
string = string.replace(reRelativePath, replacement);
if (replacement.length > 0) {
str = trimRepeated(str, replacement);
str = str.length > 1 ? stripOuter(str, replacement) : str;
string = trimRepeated(string, replacement);
string = string.length > 1 ? stripOuter(string, replacement) : string;
}
str = str.slice(0, MAX_FILENAME_LENGTH);
string = filenameReservedRegex.windowsNames().test(string) ? string + replacement : string;
string = string.slice(0, MAX_FILENAME_LENGTH);
return str;
return string;
};
fn.path = function (pth, opts) {
fn.path = (pth, options) => {
pth = path.resolve(pth);
return path.join(path.dirname(pth), fn(path.basename(pth), opts));
return path.join(path.dirname(pth), fn(path.basename(pth), options));
};
module.exports = fn;