Galerie und tage

This commit is contained in:
2021-11-23 17:56:26 +01:00
parent ff35366279
commit 5f873bee89
4693 changed files with 149659 additions and 301447 deletions

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

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