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

29
node_modules/plur/index.js generated vendored
View File

@@ -1,20 +1,31 @@
'use strict';
var irregularPlurals = require('irregular-plurals');
const irregularPlurals = require('irregular-plurals');
module.exports = function (str, plural, count) {
module.exports = (word, plural, count) => {
if (typeof plural === 'number') {
count = plural;
}
if (str in irregularPlurals) {
plural = irregularPlurals[str];
if (irregularPlurals.has(word.toLowerCase())) {
plural = irregularPlurals.get(word.toLowerCase());
const firstLetter = word.charAt(0);
const isFirstLetterUpperCase = firstLetter === firstLetter.toUpperCase();
if (isFirstLetterUpperCase) {
plural = firstLetter.toUpperCase() + plural.slice(1);
}
const isWholeWordUpperCase = word === word.toUpperCase();
if (isWholeWordUpperCase) {
plural = plural.toUpperCase();
}
} else if (typeof plural !== 'string') {
plural = (str.replace(/(?:s|x|z|ch|sh)$/i, '$&e').replace(/([^aeiou])y$/i, '$1ie') + 's')
.replace(/i?e?s$/i, function (m) {
var isTailLowerCase = str.slice(-1) === str.slice(-1).toLowerCase();
return isTailLowerCase ? m.toLowerCase() : m.toUpperCase();
plural = (word.replace(/(?:s|x|z|ch|sh)$/i, '$&e').replace(/([^aeiou])y$/i, '$1ie') + 's')
.replace(/i?e?s$/i, match => {
const isTailLowerCase = word.slice(-1) === word.slice(-1).toLowerCase();
return isTailLowerCase ? match.toLowerCase() : match.toUpperCase();
});
}
return count === 1 ? str : plural;
return Math.abs(count) === 1 ? word : plural;
};